diff options
author | Ram Rachum <ram@rachum.com> | 2020-06-12 19:00:36 +0300 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-06-13 17:42:52 +0800 |
commit | 99ba753b837faab0509728ee455507f1a682b471 (patch) | |
tree | 5340a06b64d60550e66d509c92b78c9b018a6b00 /git/refs/symbolic.py | |
parent | 4720e6337bb14f24ec0b2b4a96359a9460dadee4 (diff) | |
download | gitpython-99ba753b837faab0509728ee455507f1a682b471.tar.gz |
Fix exception causes in 7 modules
Diffstat (limited to 'git/refs/symbolic.py')
-rw-r--r-- | git/refs/symbolic.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index ee006cbc..550464e5 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -219,8 +219,8 @@ class SymbolicReference(object): else: try: invalid_type = self.repo.rev_parse(commit).type != Commit.type - except (BadObject, BadName): - raise ValueError("Invalid object: %s" % commit) + except (BadObject, BadName) as e: + raise ValueError("Invalid object: %s" % commit) from e # END handle exception # END verify type @@ -301,8 +301,8 @@ class SymbolicReference(object): try: obj = self.repo.rev_parse(ref + "^{}") # optionally deref tags write_value = obj.hexsha - except (BadObject, BadName): - raise ValueError("Could not extract object from %s" % ref) + except (BadObject, BadName) as e: + raise ValueError("Could not extract object from %s" % ref) from e # END end try string else: raise ValueError("Unrecognized Value: %r" % ref) |