Skip to content

Commit

Permalink
feat(throw): fixed throw type mismatch bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhifenglee-aelf committed Oct 29, 2024
1 parent c861dac commit f964af4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AElf.ExceptionHandler/ExceptionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private Result HandleInnerException(Exception exception, MethodExecutionArgs arg

if (flowBehavior.ExceptionHandlingStrategy == ExceptionHandlingStrategy.Throw)
{
if (!typeof(Exception).IsAssignableFrom(args.MethodInfo.ReturnType))
if (!(flowBehavior.ReturnValue is Exception))
{
throw new ReturnTypeMismatchException(
"Return type mismatch when trying to throw a new exception. ReturnValue should be of type Exception.");
Expand Down

0 comments on commit f964af4

Please sign in to comment.