Skip to content

ScriptError

ScriptError: ContractError | InvalidBytecodeError | InvalidDeployedBytecodeError

Error type of errors thrown by the tevm_script procedure

Example

const {errors} = await tevm.script({address: '0x1234'})
if (errors?.length) {
console.log(errors[0].name) // InvalidBytecodeError
console.log(errors[0].message) // Invalid bytecode should be a hex string: 1234
}

Source

packages/errors/src/actions/ScriptError.ts:13