diff --git a/src/ApplicationLogs/LogReader.cs b/src/ApplicationLogs/LogReader.cs index 8405cab54..a2fd56e16 100644 --- a/src/ApplicationLogs/LogReader.cs +++ b/src/ApplicationLogs/LogReader.cs @@ -165,14 +165,7 @@ void IPersistencePlugin.OnPersist(Block block, StoreView snapshot, IReadOnlyList static string GetExceptionMessage(Exception exception) { - if (exception == null) return null; - - if (exception.InnerException != null) - { - return GetExceptionMessage(exception.InnerException); - } - - return exception.Message; + return exception?.GetBaseException().Message; } } } diff --git a/src/RpcServer/RpcServer.SmartContract.cs b/src/RpcServer/RpcServer.SmartContract.cs index 4fcc68d51..1f19e5c65 100644 --- a/src/RpcServer/RpcServer.SmartContract.cs +++ b/src/RpcServer/RpcServer.SmartContract.cs @@ -206,14 +206,7 @@ protected virtual JObject GetUnclaimedGas(JArray _params) static string GetExceptionMessage(Exception exception) { - if (exception == null) return null; - - if (exception.InnerException != null) - { - return exception.InnerException.Message; - } - - return exception.Message; + return exception?.GetBaseException().Message; } } }