Skip to content

Commit

Permalink
fix: also catch ODBErrors for local git
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Nov 15, 2024
1 parent b28caf7 commit c4153de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/githarbor/providers/localtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import git
from git.exc import GitError
from gitdb.exc import ODBError

from githarbor.core.models import Branch, Commit, Tag, User
from githarbor.exceptions import ResourceNotFoundError
Expand Down Expand Up @@ -57,7 +58,7 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:

try:
return func(*args, **kwargs)
except GitError as e:
except (GitError, ODBError) as e:
msg = error_msg_template.format(**params, error=str(e))
raise ResourceNotFoundError(msg) from e

Expand Down

0 comments on commit c4153de

Please sign in to comment.