MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / checkError

Function checkError

internal/ext/wasm/wasm.go:251–268  ·  view source on GitHub ↗
(err error, stderr bytes.Buffer)

Source from the content-addressed store, hash-verified

249}
250
251func 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}

Callers 1

InvokeMethod · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected