Skip to content

Commit

Permalink
get message of base exception (neo-project#463)
Browse files Browse the repository at this point in the history
* get baseexception message

* update base exception message

* more fixes
  • Loading branch information
bettybao1209 authored and joeqian10 committed Apr 7, 2021
1 parent 527b5c6 commit 1662646
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
9 changes: 1 addition & 8 deletions src/ApplicationLogs/LogReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
9 changes: 1 addition & 8 deletions src/RpcServer/RpcServer.SmartContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

0 comments on commit 1662646

Please sign in to comment.