DefaultHttpErrorHandler

play.api.http.DefaultHttpErrorHandler
See theDefaultHttpErrorHandler companion object

The default HTTP error handler.

This class is intended to be extended, allowing users to reuse some of the functionality provided here.

Value parameters

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.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Constructors

def this(environment: Environment, configuration: Configuration, sourceMapper: Option[SourceMapper], router: => Option[Router])

Value parameters

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.

Attributes

def this(environment: Environment, configuration: Configuration, sourceMapper: OptionalSourceMapper, router: Provider[Router])

Concrete methods

override 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.

Value parameters

message

The error message.

request

The request that caused the client error.

statusCode

The error status code. Must be greater or equal to 400, and less than 500.

Attributes

Definition Classes
override 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.

Value parameters

exception

The server error.

request

The request that triggered the server error.

Attributes

Definition Classes
def setPlayEditor(editor: String): Unit

Sets the play editor to the given string after initialization. Used for tests, or cases where the existing configuration isn't sufficient.

Sets the play editor to the given string after initialization. Used for tests, or cases where the existing configuration isn't sufficient.

Value parameters

editor

the play editor string.

Attributes