vm: wrap cross-contract exceptions
This commit is contained in:
parent
a39b7cc3fd
commit
a79c80cb8d
2 changed files with 11 additions and 4 deletions
|
@ -1595,7 +1595,11 @@ func (v *VM) unloadContext(ctx *Context) {
|
|||
if ctx.onUnload != nil {
|
||||
err := ctx.onUnload(v.uncaughtException == nil)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("context unload callback failed: %w", err))
|
||||
errMessage := fmt.Sprintf("context unload callback failed: %s", err)
|
||||
if v.uncaughtException != nil {
|
||||
errMessage = fmt.Sprintf("%s, uncaught exception: %s", errMessage, v.uncaughtException)
|
||||
}
|
||||
panic(errors.New(errMessage))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue