Skip to content

Commit

Permalink
evm: fix err handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jochem-brouwer committed Oct 1, 2024
1 parent d00b7bf commit 71e77dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/evm/src/interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ export class Interpreter {
if (overheadTimer !== undefined) {
this.performanceLogger.unpauseTimer(overheadTimer)
}
// re-throw on non-VM errors
if (!('errorType' in e && e.errorType === 'EvmError')) {
// re-throw on non-VM-runtime errors
if (getRuntimeError(e) === undefined) {
throw e
}
// STOP is not an exception
Expand Down
2 changes: 1 addition & 1 deletion packages/util/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type EthereumJSErrorObject = {
*/
export class EthereumJSError<T extends { code: string }> extends Error {
type: T
code: string
code: string // TODO likely remove this and for error inspection inspect `error.type.code` (like Lodestar)
constructor(type: T, message?: string, stack?: string) {
super(message ?? type.code)
this.type = type
Expand Down

0 comments on commit 71e77dc

Please sign in to comment.