MCPcopy Create free account
hub / github.com/buke/quickjs-go / throwProxyError

Function throwProxyError

error_bridge.go:33–43  ·  view source on GitHub ↗

throwProxyError creates and returns a JavaScript error.

(ctx *C.JSContext, err proxyError)

Source from the content-addressed store, hash-verified

31
32// throwProxyError creates and returns a JavaScript error.
33func throwProxyError(ctx *C.JSContext, err proxyError) C.JSValue {
34 msg := C.CString(err.message)
35 defer C.free(unsafe.Pointer(msg))
36
37 switch err.errorType {
38 case "TypeError":
39 return C.ThrowTypeError(ctx, msg)
40 default:
41 return C.ThrowInternalError(ctx, msg)
42 }
43}
44
45// throwModuleError creates and throws a module initialization error.
46func throwModuleError(ctx *C.JSContext, err error) C.int {

Callers 5

goClassConstructorProxyFunction · 0.85
goFunctionProxyFunction · 0.85
goClassMethodProxyFunction · 0.85
goClassGetterProxyFunction · 0.85
goClassSetterProxyFunction · 0.85

Calls 2

ThrowTypeErrorMethod · 0.80
ThrowInternalErrorMethod · 0.80

Tested by

no test coverage detected