Module io.helidon.webserver.jsonrpc
Package io.helidon.webserver.jsonrpc
Interface JsonRpcExceptionHandler
- All Superinterfaces:
ServerLifecycle
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An exception handler that can be registered to map exceptions thrown in method
handlers to
JsonRpcError
s.-
Method Summary
Modifier and TypeMethodDescriptionhandle
(JsonRpcRequest req, JsonRpcResponse res, Throwable throwable) Handler for exceptions thrown in JSON-RPC method handlers.Methods inherited from interface io.helidon.webserver.ServerLifecycle
afterStart, afterStop, beforeStart
-
Method Details
-
handle
Optional<JsonRpcError> handle(JsonRpcRequest req, JsonRpcResponse res, Throwable throwable) throws Exception Handler for exceptions thrown in JSON-RPC method handlers.- Parameters:
req
- the server requestres
- the server responsethrowable
- the throwable thrown by the method handler- Returns:
- an optional JSON-RPC error to be returned to the client. If the returned
optional is empty, then an error with code
JsonRpcError.INTERNAL_ERROR
is sent instead. - Throws:
Exception
- if an unexpected condition is found
-