Skip to content

Commit

Permalink
vdk-core: fix exception cause swallowing
Browse files Browse the repository at this point in the history
Why?

report_and_throw swallows the actual exception cause if
we don't pass a cause

What?

Remove the cause parameter (it's not used anywhere)

How was this tested?

CI

What kind of change is this?

Bugfix

Signed-off-by: Dilyan Marinov <[email protected]>
  • Loading branch information
Dilyan Marinov committed Nov 28, 2023
1 parent 6951f6f commit a16c288
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions projects/vdk-core/src/vdk/internal/core/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,7 @@ def report(error_type: ResolvableBy, exception: BaseException):


def report_and_throw(
exception: BaseVdkError,
resolvable_by: ResolvableBy = None,
cause: BaseException = None,
exception: BaseVdkError, resolvable_by: ResolvableBy = None
) -> None:
"""
Add exception to resolvable context and then throw it to be handled up the stack.
Expand All @@ -205,7 +203,7 @@ def report_and_throw(
exception,
)
)
raise exception from cause
raise exception


def report_and_rethrow(error_type: ResolvableBy, exception: BaseException) -> None:
Expand Down

0 comments on commit a16c288

Please sign in to comment.