class DefaultHttpErrorHandler extends HttpErrorHandler
The default HTTP error handler.
This class is intended to be extended, allowing users to reuse some of the functionality provided here.
- Annotations
- @Singleton()
- Source
- HttpErrorHandler.scala
- Alphabetic
- By Inheritance
- DefaultHttpErrorHandler
- HttpErrorHandler
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new DefaultHttpErrorHandler(environment: Environment, configuration: Configuration, sourceMapper: OptionalSourceMapper, router: Provider[Router])
- Annotations
- @Inject()
- new DefaultHttpErrorHandler(environment: Environment, configuration: Configuration, sourceMapper: Option[SourceMapper], router: => Option[Router])
- environment
The environment
- router
An optional router. If provided, in dev mode, will be used to display more debug information when a handler can't be found. This is a lazy parameter, to avoid circular dependency issues, since the router may well depend on this.
- new DefaultHttpErrorHandler(config: HttpErrorConfig = HttpErrorConfig(), sourceMapper: Option[SourceMapper] = None, router: => Option[Router] = None)
- router
An optional router. If provided, in dev mode, will be used to display more debug information when a handler can't be found. This is a lazy parameter, to avoid circular dependency issues, since the router may well depend on this.
Value Members
- def onClientError(request: RequestHeader, statusCode: Int, message: String): Future[Result]
Invoked when a client error occurs, that is, an error in the 4xx series.
Invoked when a client error occurs, that is, an error in the 4xx series.
- request
The request that caused the client error.
- statusCode
The error status code. Must be greater or equal to 400, and less than 500.
- message
The error message.
- Definition Classes
- DefaultHttpErrorHandler → HttpErrorHandler
- def onServerError(request: RequestHeader, exception: Throwable): Future[Result]
Invoked when a server error occurs.
Invoked when a server error occurs.
By default, the implementation of this method delegates to onProdServerError when in prod mode, and onDevServerError in dev mode. It is recommended, if you want Play's debug info on the error page in dev mode, that you override onProdServerError instead of this method.
- request
The request that triggered the server error.
- exception
The server error.
- Definition Classes
- DefaultHttpErrorHandler → HttpErrorHandler
- def setPlayEditor(editor: String): Unit
Sets the play editor to the given string after initialization.
Sets the play editor to the given string after initialization. Used for tests, or cases where the existing configuration isn't sufficient.
- editor
the play editor string.