jsonrpc4j
jsonrpc4j copied to clipboard
Error resolver improvement
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"
}
}
}