MCPcopy Create free account
hub / github.com/apache/dubbo-go / runScript

Method runScript

cluster/router/script/instance/js_instance.go:188–204  ·  view source on GitHub ↗
(pg *goja.Program)

Source from the content-addressed store, hash-verified

186}
187
188func (j jsInstance) runScript(pg *goja.Program) (res any, err error) {
189 defer func(res *any, err *error) {
190 if panicReason := recover(); panicReason != nil {
191 *res = nil
192 switch panicReason := panicReason.(type) {
193 case string:
194 *err = fmt.Errorf("panic: %s", panicReason)
195 case error:
196 *err = panicReason
197 default:
198 *err = fmt.Errorf("panic occurred: failed to retrieve panic information. Expected string or error, got %T", panicReason)
199 }
200 }
201 }(&res, &err)
202 res, err = j.rt.RunProgram(pg)
203 return res, err
204}

Callers 1

RunMethod · 0.45

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected