You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
613 B
24 lines
613 B
import ErrorResponseFactory from './ErrorResponseFactory.ts'
|
|
import HTTPError from '../../error/HTTPError.ts'
|
|
|
|
/**
|
|
* Response factory that renders a given HTTP error.
|
|
* @extends ErrorResponseFactory
|
|
*/
|
|
export default class HTTPErrorResponseFactory extends ErrorResponseFactory {
|
|
constructor(
|
|
/**
|
|
* The HTTP error to render.
|
|
* @type HTTPError
|
|
*/
|
|
public readonly error: HTTPError,
|
|
/**
|
|
* The output format.
|
|
* @type 'json' | 'html'
|
|
*/
|
|
output: 'json' | 'html',
|
|
) {
|
|
super(error, error.http_status, output)
|
|
}
|
|
}
|