From f964af47e5532f8ebbc3d00818f0b2e0976a5b47 Mon Sep 17 00:00:00 2001 From: zhifenglee-aelf Date: Tue, 29 Oct 2024 18:29:36 +0800 Subject: [PATCH] feat(throw): fixed throw type mismatch bug --- AElf.ExceptionHandler/ExceptionHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AElf.ExceptionHandler/ExceptionHandler.cs b/AElf.ExceptionHandler/ExceptionHandler.cs index cf15cff..f7f413b 100644 --- a/AElf.ExceptionHandler/ExceptionHandler.cs +++ b/AElf.ExceptionHandler/ExceptionHandler.cs @@ -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.");