Skip to content

Commit

Permalink
Improve max code size error message
Browse files Browse the repository at this point in the history
  • Loading branch information
arcz committed Jun 6, 2024
1 parent 5a366d2 commit dcaad43
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/Echidna/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,18 @@ import EVM.Types
data ExecException = IllegalExec EvmError | UnknownFailure EvmError

instance Show ExecException where
show (IllegalExec e) = "VM attempted an illegal operation: " ++ show e
show (UnknownFailure e) = "VM failed for unhandled reason, " ++ show e
++ ". This shouldn't happen. Please file a ticket with this error message and steps to reproduce!"
show = \case
IllegalExec e -> "VM attempted an illegal operation: " ++ show e
UnknownFailure (MaxCodeSizeExceeded limit actual) ->
"Max code size exceeded. " ++ codeSizeErrorDetails limit actual
UnknownFailure (MaxInitCodeSizeExceeded limit actual) ->
"Max init code size exceeded. " ++ codeSizeErrorDetails limit actual
UnknownFailure e -> "VM failed for unhandled reason, " ++ show e
++ ". This shouldn't happen. Please file a ticket with this error message and steps to reproduce!"
where
codeSizeErrorDetails limit actual =
"Configured limit: " ++ show limit ++ ", actual: " ++ show actual
++ ". Set 'codeSize: 0xffffffff' in the config file to increase the limit."

instance Exception ExecException

Expand Down

0 comments on commit dcaad43

Please sign in to comment.