Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Commit cdb2f03

Browse files
authored
Return hex data if error cannot be decoded as a revert or panic (#380)
1 parent 2888075 commit cdb2f03

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/entrypoint/execution/trace.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ func TraceSimulateHandleOp(in *TraceInput) (*TraceOutput, error) {
149149
if revErr != nil {
150150
code, panErr := errors.DecodePanic(data)
151151
if panErr != nil {
152-
return nil, fmt.Errorf("%s, %s", revErr, panErr)
152+
return nil, errors.NewRPCError(
153+
errors.EXECUTION_REVERTED,
154+
"execution reverted with data",
155+
hexutil.Encode(data),
156+
)
153157
}
154158

155159
return out, errors.NewRPCError(

0 commit comments

Comments
 (0)