Skip to content

Commit

Permalink
vdk-core: fix exception cause swallowing (#2949)
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)

## How was this tested?

CI

## What kind of change is this?

Bugfix

Signed-off-by: Dilyan Marinov <[email protected]>
Co-authored-by: Dilyan Marinov <[email protected]>
  • Loading branch information
DeltaMichael and Dilyan Marinov authored Nov 28, 2023
1 parent 6951f6f commit 709070b
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 709070b

Please sign in to comment.