MCPcopy Index your code
hub / github.com/docker/docker-agent / jsError

Function jsError

cmd/wasm/bridge.go:26–28  ·  view source on GitHub ↗

jsError wraps a Go error in a JS Error so it can be passed to Promise.reject.

(err error)

Source from the content-addressed store, hash-verified

24
25// jsError wraps a Go error in a JS Error so it can be passed to Promise.reject.
26func jsError(err error) js.Value {
27 return js.Global().Get("Error").New(err.Error())
28}
29
30// rejectedPromise returns a Promise that rejects immediately with msg.
31// Used when we can detect a bad call before launching a goroutine.

Callers 2

rejectedPromiseFunction · 0.85
chatJSFunction · 0.85

Calls 3

GetMethod · 0.65
NewMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected