UNPKG

1.46 kBTypeScriptView Raw
1import { HttpException } from './http.exception';
2/**
3 * Defines an HTTP exception for *Gatway Timeout* type errors.
4 *
5 * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
6 *
7 * @publicApi
8 */
9export declare class GatewayTimeoutException extends HttpException {
10 /**
11 * Instantiate a `GatewayTimeoutException` Exception.
12 *
13 * @example
14 * `throw new GatewayTimeoutException()`
15 *
16 * @usageNotes
17 * The constructor arguments define the HTTP response.
18 * - The `message` argument defines the JSON response body.
19 * - The `error` argument defines the HTTP Status Code.
20 *
21 * By default, the JSON response body contains two properties:
22 * - `statusCode`: defaults to the Http Status Code provided in the `error` argument
23 * - `message`: the string `'Gateway Timeout'` by default; override this by supplying
24 * a string in the `message` parameter.
25 *
26 * To override the entire JSON response body, pass an object. Nest will serialize
27 * the object and return it as the JSON response body.
28 *
29 * The `error` argument is required, and should be a valid HTTP status code.
30 * Best practice is to use the `HttpStatus` enum imported from `nestjs/common`.
31 *
32 * @param message string or object describing the error condition.
33 * @param error HTTP response status code
34 */
35 constructor(message?: string | object | any, error?: string);
36}