@absolunet/ioc2.1.0

View on GitHub

Driver

Abstract exception handler driver that defines all the methods to be implemented.

Extends

Members

engine :*

Source:
Inherited From:
Current engine accessor.

Methods

(async, abstract) render(exception, requestopt, responseopt)

Source:
Render the exception in the response.
Parameters:
Name Type Attributes Description
exception Error The exception to render.
request request <optional>
The current request.
response response <optional>
The current response.
Returns:
The async process promise, if async.
Type
Promise | void

wantsJson(request)

Source:
Check if request wants JSON response.
Parameters:
Name Type Description
request request The current request instance.
Returns:
Indicates that the request wants JSON response.
Type
boolean

renderJson(exception)

Source:
Return a JSON renderable object that represents the exception.
Parameters:
Name Type Description
exception Error The current exception.
Returns:
- The renderable object.
Type
Object

setEngine(engine)

Source:
Inherited From:
Set current engine.
Parameters:
Name Type Description
engine * The engine instance.
Returns:
The current instance.
Type
support.mixins.HasEngine