From 7a20c15fd1af66222b6a89ce6d6e2466de66cad6 Mon Sep 17 00:00:00 2001 From: zhifenglee-aelf Date: Tue, 15 Oct 2024 18:34:37 +0800 Subject: [PATCH] feat(handler): allow protected and private fields for handler --- 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 98bf717..84e2973 100644 --- a/AElf.ExceptionHandler/ExceptionHandler.cs +++ b/AElf.ExceptionHandler/ExceptionHandler.cs @@ -392,7 +392,7 @@ private static string CacheKey(Type targetType, string methodName) private static ExceptionHandlerInfo CreateExceptionHandlerInfo(Type targetType, string methodName) { Func> methodToCall; - var methodInfo = targetType.GetMethod(methodName); + var methodInfo = targetType.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); var methodParams = methodInfo.GetParameters(); var instanceParameter = Expression.Parameter(typeof(object), "instance");