File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -547,15 +547,14 @@ func runWasm[I, O proto.Message](
547547 _ , err = start .Call (store )
548548 executionDuration := time .Since (startTime )
549549
550- // Is this an intentional controlled exit (such as the epoch deadline trap firing, not an error in the wasi runtime)
551- var intentionalControlledExit bool
552- switch v := err .(type ) { // This error will never be wrapped
553- case * wasmtime.Error :
554- _ , intentionalControlledExit = v .ExitStatus ()
555- default :
550+ // Is this an intentional controlled exit? (such as the epoch deadline trap firing, not an error in the wasi runtime)
551+ intentionalControlledExit := false
552+ var wtErr * wasmtime.Error
553+ if errors .As (err , & wtErr ) {
554+ _ , intentionalControlledExit = wtErr .ExitStatus ()
556555 }
557556
558- // If it's a controlled exit and the timeout has been reached or exceeded, we return a timeout error
557+ // If it's a controlled exit and the timeout has been reached or exceeded, return a timeout error
559558 // Note - there is no other reliable signal on the error that can be used to infer it is due to a timeout (epoch deadline
560559 // being reached) and if it is a controlled exit then the chances of it being anything other than a timeout are very
561560 // low if the timeout has been exceeded
You can’t perform that action at this time.
0 commit comments