Package ratpack.core.error
Interface ServerErrorHandler
-
public interface ServerErrorHandler
An object that can deal with errors that occur during the processing of an exchange. Typically retrieved from the exchange service.- See Also:
Context.error(Throwable)
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.common.reflect.TypeToken<ServerErrorHandler>
TYPE
A type token for this type.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
error(Context context, Throwable throwable)
Processes the given exception that occurred processing the given context.default void
error(Context context, InvalidPathEncodingException exception)
Processes the given request path encoding error that occurred processing the given context.
-
-
-
Field Detail
-
TYPE
static final com.google.common.reflect.TypeToken<ServerErrorHandler> TYPE
A type token for this type.- Since:
- 1.1
-
-
Method Detail
-
error
@NonBlocking void error(Context context, Throwable throwable) throws Exception
Processes the given exception that occurred processing the given context.Implementations should strive to avoid throwing exceptions. If exceptions are thrown, they will just be logged at a warning level and the response will be finalised with a 500 error code and empty body.
- Parameters:
context
- The context being processedthrowable
- The throwable that occurred- Throws:
Exception
- if something goes wrong handling the error
-
error
@NonBlocking default void error(Context context, InvalidPathEncodingException exception) throws Exception
Processes the given request path encoding error that occurred processing the given context.Implementations should strive to avoid throwing exceptions. If exceptions are thrown, they will just be logged at a warning level and the response will be finalised with a 500 error code and empty body.
- Parameters:
context
- The context being processedexception
- The path encoding error that occurred- Throws:
Exception
- if something goes wrong handling the error- Since:
- 1.5
-
-