S2s api return 400 with customised json data

we want make s2s api return 400 HTTP error code with JSON data

{
"error": {
"code": "INVALID_USER",
"message": "Invalid user"
}
}

based on the document, we can use

throw {
  code: nkruntime.Codes.INVALID_ARGUMENT, // Nakama 内部映射到 HTTP 400 错误码
  message: JSON.stringify({
    error: {
      code: code,
      message: message,
    },
  }),
}

but seem like the errro attribute is build-in parameter from nakama, we cannot customised it.

we got something like this:

{
    "code": 3,
    "error": {
        "stackTrace": "[object Object]\n\tat index.js:22676:5(10)\n\tat webhookXsollaRpc (index.js:22726:28(59))\n"
    },
    "message": "{\"error\":{\"code\":\"INVALID_SIGNATURE\",\"message\":\"Invalid signature\"}}"
}

is it possible to change the error part to a customised json format?

At the moment only the message field will contain your custom string returned in the error object. The error field is always returned with the stacktrace because it can be valuable for debugging and unhandled or mishandled errors.

ok, thanks. if there is a way to customise the error response freely will be much better because some 3rd party services need some fixed format response. so far we can only use another service to transform the Nakama response to another format that matches the 3rd party requirement.