Function
checkError
(err error, stderr bytes.Buffer)
Source from the content-addressed store, hash-verified
| 249 | } |
| 250 | |
| 251 | func checkError(err error, stderr bytes.Buffer) error { |
| 252 | if err == nil { |
| 253 | return err |
| 254 | } |
| 255 | |
| 256 | if exitErr, ok := err.(*sys.ExitError); ok { |
| 257 | if exitErr.ExitCode() == 0 { |
| 258 | return nil |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | // Print WASM stdout |
| 263 | stderrBlob := stderr.String() |
| 264 | if len(stderrBlob) > 0 { |
| 265 | return errors.New(stderrBlob) |
| 266 | } |
| 267 | return fmt.Errorf("call: %w", err) |
| 268 | } |
Tested by
no test coverage detected