UNPKG

1.53 kBTypeScriptView Raw
1import { HttpException } from './http.exception';
2/**
3 * Defines an HTTP exception for *Service Unavailable* type errors.
4 *
5 * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
6 *
7 * @publicApi
8 */
9export declare class ServiceUnavailableException extends HttpException {
10 /**
11 * Instantiate a `ServiceUnavailableException` Exception.
12 *
13 * @example
14 * `throw new ServiceUnavailableException()`
15 *
16 * @usageNotes
17 * The HTTP response status code will be 503.
18 * - The `objectOrError` argument defines the JSON response body or the message string.
19 * - The `description` argument contains a short description of the HTTP error.
20 *
21 * By default, the JSON response body contains two properties:
22 * - `statusCode`: this will be the value 503.
23 * - `message`: the string `'Service Unavailable'` by default; override this by supplying
24 * a string in the `objectOrError` parameter.
25 *
26 * If the parameter `objectOrError` is a string, the response body will contain an
27 * additional property, `error`, with a short description of the HTTP error. To override the
28 * entire JSON response body, pass an object instead. Nest will serialize the object
29 * and return it as the JSON response body.
30 *
31 * @param objectOrError string or object describing the error condition.
32 * @param description a short description of the HTTP error.
33 */
34 constructor(objectOrError?: string | object | any, description?: string);
35}