Loading CHANGELOG.md +3 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,9 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr - Fix handling of leaderboard record writes that do not need to update the database. - Fix parsing edge case in TypeScript/JavaScript runtime storage delete operations. ### Changed - Set JS runtime custom error message as the returned payload message in RPC requests. ## [3.9.0] - 2021-10-29 ### Added - Allow creation of relayed matches with a name. Names will be mapped to match identifiers. Loading server/runtime_javascript.go +7 −19 Original line number Diff line number Diff line Loading @@ -74,7 +74,6 @@ func (r *RuntimeJS) GetCallback(e RuntimeExecutionMode, key string) string { type jsError struct { StackTrace string `json:"stackTrace,omitempty"` Type string `json:"type,omitempty"` custom bool error error } Loading @@ -83,22 +82,11 @@ func (e *jsError) Error() string { return e.error.Error() } func newJsUncaughtExceptionError(error error, st string, custom bool) *jsError { jsErr := &jsError{ Type: "uncaughtExceptionError", func newJsError(error error, stackTrace string, custom bool) *jsError { return &jsError{ error: error, custom: custom, } if !custom { jsErr.StackTrace = st } return jsErr } func newJsRuntimeError(err error) *jsError { return &jsError{ Type: "runtimeError", error: err, StackTrace: stackTrace, } } Loading Loading @@ -512,10 +500,10 @@ func (r *RuntimeJS) invokeFunction(execMode RuntimeExecutionMode, id string, fn if !custom { r.logger.Error("JavaScript runtime function raised an uncaught exception", zap.String("mode", execMode.String()), zap.String("id", id), zap.Error(err)) } return nil, newJsUncaughtExceptionError(errors.New(errMsg), exErr.String(), custom), errCode return nil, newJsError(errors.New(errMsg), exErr.String(), custom), errCode } r.logger.Error("JavaScript runtime function caused an error", zap.String("mode", execMode.String()), zap.String("id", id), zap.Error(err)) return nil, newJsRuntimeError(err), codes.Internal r.logger.Error("JavaScript runtime error", zap.String("mode", execMode.String()), zap.String("id", id), zap.Error(err)) return nil, err, codes.Internal } if retVal == nil || retVal == goja.Undefined() || retVal == goja.Null() { return nil, nil, codes.OK Loading Loading
CHANGELOG.md +3 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,9 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr - Fix handling of leaderboard record writes that do not need to update the database. - Fix parsing edge case in TypeScript/JavaScript runtime storage delete operations. ### Changed - Set JS runtime custom error message as the returned payload message in RPC requests. ## [3.9.0] - 2021-10-29 ### Added - Allow creation of relayed matches with a name. Names will be mapped to match identifiers. Loading
server/runtime_javascript.go +7 −19 Original line number Diff line number Diff line Loading @@ -74,7 +74,6 @@ func (r *RuntimeJS) GetCallback(e RuntimeExecutionMode, key string) string { type jsError struct { StackTrace string `json:"stackTrace,omitempty"` Type string `json:"type,omitempty"` custom bool error error } Loading @@ -83,22 +82,11 @@ func (e *jsError) Error() string { return e.error.Error() } func newJsUncaughtExceptionError(error error, st string, custom bool) *jsError { jsErr := &jsError{ Type: "uncaughtExceptionError", func newJsError(error error, stackTrace string, custom bool) *jsError { return &jsError{ error: error, custom: custom, } if !custom { jsErr.StackTrace = st } return jsErr } func newJsRuntimeError(err error) *jsError { return &jsError{ Type: "runtimeError", error: err, StackTrace: stackTrace, } } Loading Loading @@ -512,10 +500,10 @@ func (r *RuntimeJS) invokeFunction(execMode RuntimeExecutionMode, id string, fn if !custom { r.logger.Error("JavaScript runtime function raised an uncaught exception", zap.String("mode", execMode.String()), zap.String("id", id), zap.Error(err)) } return nil, newJsUncaughtExceptionError(errors.New(errMsg), exErr.String(), custom), errCode return nil, newJsError(errors.New(errMsg), exErr.String(), custom), errCode } r.logger.Error("JavaScript runtime function caused an error", zap.String("mode", execMode.String()), zap.String("id", id), zap.Error(err)) return nil, newJsRuntimeError(err), codes.Internal r.logger.Error("JavaScript runtime error", zap.String("mode", execMode.String()), zap.String("id", id), zap.Error(err)) return nil, err, codes.Internal } if retVal == nil || retVal == goja.Undefined() || retVal == goja.Null() { return nil, nil, codes.OK Loading