jsonrpc4j icon indicating copy to clipboard operation
jsonrpc4j copied to clipboard

Error resolver improvement

Open guidomedina opened this issue 6 years ago • 0 comments

Is it possible to disable the data field from the error? I would like not to expose our internal exception, when I annotate a method with:

@JsonRpcErrors({@JsonRpcError(exception=APIKeyException.class, code=32001, message="Invalid API key")})

I would like to only report an error code and message without data:

{
  "jsonrpc": "2.0",
  "id": "1",
  "error": {
    "code": 32001,
    "message": "Invalid API key",
    "data": {
      "exceptionTypeName": "some_package.APIKeyException",
      "message": "Invalid API key"
    }
  }
}

guidomedina avatar Apr 11 '18 13:04 guidomedina