life icon indicating copy to clipboard operation
life copied to clipboard

cannot return error while panic

Open elvin-du opened this issue 6 years ago • 0 comments

When there is panic inside the function, the following code will not return the error at all。Previous code is OK

//compiler/module.go
func (m *Module) CompileForInterpreter(gp GasPolicy) ([]InterpreterCode, error) {
	var (
		ret    []InterpreterCode
		retErr error
	)

	defer utils.CatchPanic(&retErr)
}

elvin-du avatar Dec 19 '19 08:12 elvin-du