Initial commit - Event Planner application

This commit is contained in:
mberlin
2026-03-18 14:55:56 -03:00
commit 86d779eb4d
7548 changed files with 1006324 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Bad Gateway* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class BadGatewayException extends HttpException {
/**
* Instantiate a `BadGatewayException` Exception.
*
* @example
* `throw new BadGatewayException()`
*
* @usageNotes
* The HTTP response status code will be 502.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 502.
* - `message`: the string `'Bad Gateway'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BadGatewayException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Bad Gateway* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class BadGatewayException extends http_exception_1.HttpException {
/**
* Instantiate a `BadGatewayException` Exception.
*
* @example
* `throw new BadGatewayException()`
*
* @usageNotes
* The HTTP response status code will be 502.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 502.
* - `message`: the string `'Bad Gateway'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Bad Gateway') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.BAD_GATEWAY), http_status_enum_1.HttpStatus.BAD_GATEWAY, httpExceptionOptions);
}
}
exports.BadGatewayException = BadGatewayException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Bad Request* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class BadRequestException extends HttpException {
/**
* Instantiate a `BadRequestException` Exception.
*
* @example
* `throw new BadRequestException()`
*
* @usageNotes
* The HTTP response status code will be 400.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 400.
* - `message`: the string `'Bad Request'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BadRequestException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Bad Request* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class BadRequestException extends http_exception_1.HttpException {
/**
* Instantiate a `BadRequestException` Exception.
*
* @example
* `throw new BadRequestException()`
*
* @usageNotes
* The HTTP response status code will be 400.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 400.
* - `message`: the string `'Bad Request'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Bad Request') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.BAD_REQUEST), http_status_enum_1.HttpStatus.BAD_REQUEST, httpExceptionOptions);
}
}
exports.BadRequestException = BadRequestException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Conflict* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class ConflictException extends HttpException {
/**
* Instantiate a `ConflictException` Exception.
*
* @example
* `throw new ConflictException()`
*
* @usageNotes
* The HTTP response status code will be 409.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 409.
* - `message`: the string `'Conflict'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConflictException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Conflict* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class ConflictException extends http_exception_1.HttpException {
/**
* Instantiate a `ConflictException` Exception.
*
* @example
* `throw new ConflictException()`
*
* @usageNotes
* The HTTP response status code will be 409.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 409.
* - `message`: the string `'Conflict'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Conflict') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.CONFLICT), http_status_enum_1.HttpStatus.CONFLICT, httpExceptionOptions);
}
}
exports.ConflictException = ConflictException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Forbidden* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class ForbiddenException extends HttpException {
/**
* Instantiate a `ForbiddenException` Exception.
*
* @example
* `throw new ForbiddenException()`
*
* @usageNotes
* The HTTP response status code will be 403.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 403.
* - `message`: the string `'Forbidden'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ForbiddenException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Forbidden* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class ForbiddenException extends http_exception_1.HttpException {
/**
* Instantiate a `ForbiddenException` Exception.
*
* @example
* `throw new ForbiddenException()`
*
* @usageNotes
* The HTTP response status code will be 403.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 403.
* - `message`: the string `'Forbidden'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Forbidden') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.FORBIDDEN), http_status_enum_1.HttpStatus.FORBIDDEN, httpExceptionOptions);
}
}
exports.ForbiddenException = ForbiddenException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Gateway Timeout* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class GatewayTimeoutException extends HttpException {
/**
* Instantiate a `GatewayTimeoutException` Exception.
*
* @example
* `throw new GatewayTimeoutException()`
*
* @usageNotes
* The HTTP response status code will be 504.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 504.
* - `message`: the string `'Gateway Timeout'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GatewayTimeoutException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Gateway Timeout* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class GatewayTimeoutException extends http_exception_1.HttpException {
/**
* Instantiate a `GatewayTimeoutException` Exception.
*
* @example
* `throw new GatewayTimeoutException()`
*
* @usageNotes
* The HTTP response status code will be 504.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 504.
* - `message`: the string `'Gateway Timeout'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Gateway Timeout') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.GATEWAY_TIMEOUT), http_status_enum_1.HttpStatus.GATEWAY_TIMEOUT, httpExceptionOptions);
}
}
exports.GatewayTimeoutException = GatewayTimeoutException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Gone* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class GoneException extends HttpException {
/**
* Instantiate a `GoneException` Exception.
*
* @example
* `throw new GoneException()`
*
* @usageNotes
* The HTTP response status code will be 410.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 410.
* - `message`: the string `'Gone'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GoneException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Gone* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class GoneException extends http_exception_1.HttpException {
/**
* Instantiate a `GoneException` Exception.
*
* @example
* `throw new GoneException()`
*
* @usageNotes
* The HTTP response status code will be 410.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 410.
* - `message`: the string `'Gone'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Gone') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.GONE), http_status_enum_1.HttpStatus.GONE, httpExceptionOptions);
}
}
exports.GoneException = GoneException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Http Version Not Supported* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class HttpVersionNotSupportedException extends HttpException {
/**
* Instantiate a `HttpVersionNotSupportedException` Exception.
*
* @example
* `throw new HttpVersionNotSupportedException()`
*
* @usageNotes
* The HTTP response status code will be 505.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 505.
* - `message`: the string `'HTTP Version Not Supported'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpVersionNotSupportedException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Http Version Not Supported* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class HttpVersionNotSupportedException extends http_exception_1.HttpException {
/**
* Instantiate a `HttpVersionNotSupportedException` Exception.
*
* @example
* `throw new HttpVersionNotSupportedException()`
*
* @usageNotes
* The HTTP response status code will be 505.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 505.
* - `message`: the string `'HTTP Version Not Supported'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'HTTP Version Not Supported') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.HTTP_VERSION_NOT_SUPPORTED), http_status_enum_1.HttpStatus.HTTP_VERSION_NOT_SUPPORTED, httpExceptionOptions);
}
}
exports.HttpVersionNotSupportedException = HttpVersionNotSupportedException;

View File

@@ -0,0 +1,85 @@
import { HttpExceptionBody, HttpExceptionBodyMessage } from '../interfaces/http/http-exception-body.interface';
import { IntrinsicException } from './intrinsic.exception';
export interface HttpExceptionOptions {
/** original cause of the error */
cause?: unknown;
description?: string;
}
export interface DescriptionAndOptions {
description?: string;
httpExceptionOptions?: HttpExceptionOptions;
}
/**
* Defines the base Nest HTTP exception, which is handled by the default
* Exceptions Handler.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class HttpException extends IntrinsicException {
private readonly response;
private readonly status;
private readonly options?;
/**
* Exception cause. Indicates the specific original cause of the error.
* It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error.
*/
cause: unknown;
/**
* Instantiate a plain HTTP Exception.
*
* @example
* throw new HttpException('message', HttpStatus.BAD_REQUEST)
* throw new HttpException('custom message', HttpStatus.BAD_REQUEST, {
* cause: new Error('Cause Error'),
* })
*
*
* @usageNotes
* The constructor arguments define the response and the HTTP response status code.
* - The `response` argument (required) defines the JSON response body. alternatively, it can also be
* an error object that is used to define an error [cause](https://nodejs.org/en/blog/release/v16.9.0/#error-cause).
* - The `status` argument (required) defines the HTTP Status Code.
* - The `options` argument (optional) defines additional error options. Currently, it supports the `cause` attribute,
* and can be used as an alternative way to specify the error cause: `const error = new HttpException('description', 400, { cause: new Error() });`
*
* By default, the JSON response body contains two properties:
* - `statusCode`: the Http Status Code.
* - `message`: a short description of the HTTP error by default; override this
* by supplying a string in the `response` parameter.
*
* To override the entire JSON response body, pass an object to the `createBody`
* method. Nest will serialize the object and return it as the JSON response body.
*
* The `status` argument is required, and should be a valid HTTP status code.
* Best practice is to use the `HttpStatus` enum imported from `nestjs/common`.
*
* @param response string, object describing the error condition or the error cause.
* @param status HTTP response status code.
* @param options An object used to add an error cause.
*/
constructor(response: string | Record<string, any>, status: number, options?: HttpExceptionOptions | undefined);
/**
* Configures error chaining support
*
* @see https://nodejs.org/en/blog/release/v16.9.0/#error-cause
* @see https://github.com/microsoft/TypeScript/issues/45167
*/
initCause(): void;
initMessage(): void;
initName(): void;
getResponse(): string | object;
getStatus(): number;
static createBody(nil: null | '', message: HttpExceptionBodyMessage, statusCode: number): HttpExceptionBody;
static createBody(message: HttpExceptionBodyMessage, error: string, statusCode: number): HttpExceptionBody;
static createBody<Body extends Record<string, unknown>>(custom: Body): Body;
static getDescriptionFrom(descriptionOrOptions: string | HttpExceptionOptions): string;
static getHttpExceptionOptionsFrom(descriptionOrOptions: string | HttpExceptionOptions): HttpExceptionOptions;
/**
* Utility method used to extract the error description and httpExceptionOptions from the given argument.
* This is used by inheriting classes to correctly parse both options.
* @returns the error description and the httpExceptionOptions as an object.
*/
static extractDescriptionAndOptionsFrom(descriptionOrOptions: string | HttpExceptionOptions): DescriptionAndOptions;
}

View File

@@ -0,0 +1,133 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpException = void 0;
const shared_utils_1 = require("../utils/shared.utils");
const intrinsic_exception_1 = require("./intrinsic.exception");
/**
* Defines the base Nest HTTP exception, which is handled by the default
* Exceptions Handler.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class HttpException extends intrinsic_exception_1.IntrinsicException {
/**
* Instantiate a plain HTTP Exception.
*
* @example
* throw new HttpException('message', HttpStatus.BAD_REQUEST)
* throw new HttpException('custom message', HttpStatus.BAD_REQUEST, {
* cause: new Error('Cause Error'),
* })
*
*
* @usageNotes
* The constructor arguments define the response and the HTTP response status code.
* - The `response` argument (required) defines the JSON response body. alternatively, it can also be
* an error object that is used to define an error [cause](https://nodejs.org/en/blog/release/v16.9.0/#error-cause).
* - The `status` argument (required) defines the HTTP Status Code.
* - The `options` argument (optional) defines additional error options. Currently, it supports the `cause` attribute,
* and can be used as an alternative way to specify the error cause: `const error = new HttpException('description', 400, { cause: new Error() });`
*
* By default, the JSON response body contains two properties:
* - `statusCode`: the Http Status Code.
* - `message`: a short description of the HTTP error by default; override this
* by supplying a string in the `response` parameter.
*
* To override the entire JSON response body, pass an object to the `createBody`
* method. Nest will serialize the object and return it as the JSON response body.
*
* The `status` argument is required, and should be a valid HTTP status code.
* Best practice is to use the `HttpStatus` enum imported from `nestjs/common`.
*
* @param response string, object describing the error condition or the error cause.
* @param status HTTP response status code.
* @param options An object used to add an error cause.
*/
constructor(response, status, options) {
super();
this.response = response;
this.status = status;
this.options = options;
this.initMessage();
this.initName();
this.initCause();
}
/**
* Configures error chaining support
*
* @see https://nodejs.org/en/blog/release/v16.9.0/#error-cause
* @see https://github.com/microsoft/TypeScript/issues/45167
*/
initCause() {
if (this.options?.cause) {
this.cause = this.options.cause;
return;
}
}
initMessage() {
if ((0, shared_utils_1.isString)(this.response)) {
this.message = this.response;
}
else if ((0, shared_utils_1.isObject)(this.response) && (0, shared_utils_1.isString)(this.response.message)) {
this.message = this.response.message;
}
else if (this.constructor) {
this.message =
this.constructor.name.match(/[A-Z][a-z]+|[0-9]+/g)?.join(' ') ??
'Error';
}
}
initName() {
this.name = this.constructor.name;
}
getResponse() {
return this.response;
}
getStatus() {
return this.status;
}
static createBody(arg0, arg1, statusCode) {
if (!arg0) {
return {
message: arg1,
statusCode: statusCode,
};
}
if ((0, shared_utils_1.isString)(arg0) || Array.isArray(arg0) || (0, shared_utils_1.isNumber)(arg0)) {
return {
message: arg0,
error: arg1,
statusCode: statusCode,
};
}
return arg0;
}
static getDescriptionFrom(descriptionOrOptions) {
return (0, shared_utils_1.isString)(descriptionOrOptions)
? descriptionOrOptions
: descriptionOrOptions?.description;
}
static getHttpExceptionOptionsFrom(descriptionOrOptions) {
return (0, shared_utils_1.isString)(descriptionOrOptions) ? {} : descriptionOrOptions;
}
/**
* Utility method used to extract the error description and httpExceptionOptions from the given argument.
* This is used by inheriting classes to correctly parse both options.
* @returns the error description and the httpExceptionOptions as an object.
*/
static extractDescriptionAndOptionsFrom(descriptionOrOptions) {
const description = (0, shared_utils_1.isString)(descriptionOrOptions)
? descriptionOrOptions
: descriptionOrOptions?.description;
const httpExceptionOptions = (0, shared_utils_1.isString)(descriptionOrOptions)
? {}
: descriptionOrOptions;
return {
description,
httpExceptionOptions,
};
}
}
exports.HttpException = HttpException;

View File

@@ -0,0 +1,38 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *ImATeapotException* type errors.
*
* Any attempt to brew coffee with a teapot should result in the error code
* "418 I'm a teapot". The resulting entity body MAY be short and stout.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class ImATeapotException extends HttpException {
/**
* Instantiate an `ImATeapotException` Exception.
*
* @example
* `throw new ImATeapotException()`
*
* @usageNotes
* The HTTP response status code will be 418.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 418.
* - `message`: the string `"I'm a Teapot"` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,46 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImATeapotException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *ImATeapotException* type errors.
*
* Any attempt to brew coffee with a teapot should result in the error code
* "418 I'm a teapot". The resulting entity body MAY be short and stout.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class ImATeapotException extends http_exception_1.HttpException {
/**
* Instantiate an `ImATeapotException` Exception.
*
* @example
* `throw new ImATeapotException()`
*
* @usageNotes
* The HTTP response status code will be 418.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 418.
* - `message`: the string `"I'm a Teapot"` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = `I'm a teapot`) {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.I_AM_A_TEAPOT), http_status_enum_1.HttpStatus.I_AM_A_TEAPOT, httpExceptionOptions);
}
}
exports.ImATeapotException = ImATeapotException;

23
node_modules/@nestjs/common/exceptions/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,23 @@
export * from './bad-gateway.exception';
export * from './bad-request.exception';
export * from './conflict.exception';
export * from './forbidden.exception';
export * from './gateway-timeout.exception';
export * from './gone.exception';
export * from './http-version-not-supported.exception';
export * from './http.exception';
export * from './im-a-teapot.exception';
export * from './internal-server-error.exception';
export * from './intrinsic.exception';
export * from './method-not-allowed.exception';
export * from './misdirected.exception';
export * from './not-acceptable.exception';
export * from './not-found.exception';
export * from './not-implemented.exception';
export * from './payload-too-large.exception';
export * from './precondition-failed.exception';
export * from './request-timeout.exception';
export * from './service-unavailable.exception';
export * from './unauthorized.exception';
export * from './unprocessable-entity.exception';
export * from './unsupported-media-type.exception';

26
node_modules/@nestjs/common/exceptions/index.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./bad-gateway.exception"), exports);
tslib_1.__exportStar(require("./bad-request.exception"), exports);
tslib_1.__exportStar(require("./conflict.exception"), exports);
tslib_1.__exportStar(require("./forbidden.exception"), exports);
tslib_1.__exportStar(require("./gateway-timeout.exception"), exports);
tslib_1.__exportStar(require("./gone.exception"), exports);
tslib_1.__exportStar(require("./http-version-not-supported.exception"), exports);
tslib_1.__exportStar(require("./http.exception"), exports);
tslib_1.__exportStar(require("./im-a-teapot.exception"), exports);
tslib_1.__exportStar(require("./internal-server-error.exception"), exports);
tslib_1.__exportStar(require("./intrinsic.exception"), exports);
tslib_1.__exportStar(require("./method-not-allowed.exception"), exports);
tslib_1.__exportStar(require("./misdirected.exception"), exports);
tslib_1.__exportStar(require("./not-acceptable.exception"), exports);
tslib_1.__exportStar(require("./not-found.exception"), exports);
tslib_1.__exportStar(require("./not-implemented.exception"), exports);
tslib_1.__exportStar(require("./payload-too-large.exception"), exports);
tslib_1.__exportStar(require("./precondition-failed.exception"), exports);
tslib_1.__exportStar(require("./request-timeout.exception"), exports);
tslib_1.__exportStar(require("./service-unavailable.exception"), exports);
tslib_1.__exportStar(require("./unauthorized.exception"), exports);
tslib_1.__exportStar(require("./unprocessable-entity.exception"), exports);
tslib_1.__exportStar(require("./unsupported-media-type.exception"), exports);

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Internal Server Error* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class InternalServerErrorException extends HttpException {
/**
* Instantiate an `InternalServerErrorException` Exception.
*
* @example
* `throw new InternalServerErrorException()`
*
* @usageNotes
* The HTTP response status code will be 500.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 500.
* - `message`: the string `'Internal Server Error'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InternalServerErrorException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Internal Server Error* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class InternalServerErrorException extends http_exception_1.HttpException {
/**
* Instantiate an `InternalServerErrorException` Exception.
*
* @example
* `throw new InternalServerErrorException()`
*
* @usageNotes
* The HTTP response status code will be 500.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 500.
* - `message`: the string `'Internal Server Error'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Internal Server Error') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.INTERNAL_SERVER_ERROR), http_status_enum_1.HttpStatus.INTERNAL_SERVER_ERROR, httpExceptionOptions);
}
}
exports.InternalServerErrorException = InternalServerErrorException;

View File

@@ -0,0 +1,8 @@
/**
* Exception that represents an intrinsic error in the application.
* When thrown, the default exception filter will not log the error message.
*
* @publicApi
*/
export declare class IntrinsicException extends Error {
}

View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IntrinsicException = void 0;
/**
* Exception that represents an intrinsic error in the application.
* When thrown, the default exception filter will not log the error message.
*
* @publicApi
*/
class IntrinsicException extends Error {
}
exports.IntrinsicException = IntrinsicException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Method Not Allowed* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class MethodNotAllowedException extends HttpException {
/**
* Instantiate a `MethodNotAllowedException` Exception.
*
* @example
* `throw new MethodNotAllowedException()`
*
* @usageNotes
* The HTTP response status code will be 405.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 405.
* - `message`: the string `'Method Not Allowed'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MethodNotAllowedException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Method Not Allowed* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class MethodNotAllowedException extends http_exception_1.HttpException {
/**
* Instantiate a `MethodNotAllowedException` Exception.
*
* @example
* `throw new MethodNotAllowedException()`
*
* @usageNotes
* The HTTP response status code will be 405.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 405.
* - `message`: the string `'Method Not Allowed'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Method Not Allowed') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.METHOD_NOT_ALLOWED), http_status_enum_1.HttpStatus.METHOD_NOT_ALLOWED, httpExceptionOptions);
}
}
exports.MethodNotAllowedException = MethodNotAllowedException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Misdirected* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class MisdirectedException extends HttpException {
/**
* Instantiate a `MisdirectedException` Exception.
*
* @example
* `throw new MisdirectedException()`
*
* @usageNotes
* The HTTP response status code will be 421.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 421.
* - `message`: the string `'Bad Gateway'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MisdirectedException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Misdirected* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class MisdirectedException extends http_exception_1.HttpException {
/**
* Instantiate a `MisdirectedException` Exception.
*
* @example
* `throw new MisdirectedException()`
*
* @usageNotes
* The HTTP response status code will be 421.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 421.
* - `message`: the string `'Bad Gateway'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Misdirected') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.MISDIRECTED), http_status_enum_1.HttpStatus.MISDIRECTED, httpExceptionOptions);
}
}
exports.MisdirectedException = MisdirectedException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Not Acceptable* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class NotAcceptableException extends HttpException {
/**
* Instantiate a `NotAcceptableException` Exception.
*
* @example
* `throw new NotAcceptableException()`
*
* @usageNotes
* The HTTP response status code will be 406.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 406.
* - `error`: the string `'Not Acceptable'` by default; override this by supplying
* a string in the `error` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotAcceptableException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Not Acceptable* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class NotAcceptableException extends http_exception_1.HttpException {
/**
* Instantiate a `NotAcceptableException` Exception.
*
* @example
* `throw new NotAcceptableException()`
*
* @usageNotes
* The HTTP response status code will be 406.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 406.
* - `error`: the string `'Not Acceptable'` by default; override this by supplying
* a string in the `error` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Not Acceptable') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.NOT_ACCEPTABLE), http_status_enum_1.HttpStatus.NOT_ACCEPTABLE, httpExceptionOptions);
}
}
exports.NotAcceptableException = NotAcceptableException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Not Found* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class NotFoundException extends HttpException {
/**
* Instantiate a `NotFoundException` Exception.
*
* @example
* `throw new NotFoundException()`
*
* @usageNotes
* The HTTP response status code will be 404.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 404.
* - `message`: the string `'Not Found'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotFoundException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Not Found* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class NotFoundException extends http_exception_1.HttpException {
/**
* Instantiate a `NotFoundException` Exception.
*
* @example
* `throw new NotFoundException()`
*
* @usageNotes
* The HTTP response status code will be 404.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 404.
* - `message`: the string `'Not Found'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Not Found') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.NOT_FOUND), http_status_enum_1.HttpStatus.NOT_FOUND, httpExceptionOptions);
}
}
exports.NotFoundException = NotFoundException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Not Implemented* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class NotImplementedException extends HttpException {
/**
* Instantiate a `NotImplementedException` Exception.
*
* @example
* `throw new NotImplementedException()`
*
* @usageNotes
* The HTTP response status code will be 501.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 501.
* - `message`: the string `'Not Implemented'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
* @param error a short description of the HTTP error.
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotImplementedException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Not Implemented* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class NotImplementedException extends http_exception_1.HttpException {
/**
* Instantiate a `NotImplementedException` Exception.
*
* @example
* `throw new NotImplementedException()`
*
* @usageNotes
* The HTTP response status code will be 501.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 501.
* - `message`: the string `'Not Implemented'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
* @param error a short description of the HTTP error.
*/
constructor(objectOrError, descriptionOrOptions = 'Not Implemented') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.NOT_IMPLEMENTED), http_status_enum_1.HttpStatus.NOT_IMPLEMENTED, httpExceptionOptions);
}
}
exports.NotImplementedException = NotImplementedException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Payload Too Large* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class PayloadTooLargeException extends HttpException {
/**
* Instantiate a `PayloadTooLargeException` Exception.
*
* @example
* `throw new PayloadTooLargeException()`
*
* @usageNotes
* The HTTP response status code will be 413.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 413.
* - `message`: the string `'Payload Too Large'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PayloadTooLargeException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Payload Too Large* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class PayloadTooLargeException extends http_exception_1.HttpException {
/**
* Instantiate a `PayloadTooLargeException` Exception.
*
* @example
* `throw new PayloadTooLargeException()`
*
* @usageNotes
* The HTTP response status code will be 413.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 413.
* - `message`: the string `'Payload Too Large'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Payload Too Large') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.PAYLOAD_TOO_LARGE), http_status_enum_1.HttpStatus.PAYLOAD_TOO_LARGE, httpExceptionOptions);
}
}
exports.PayloadTooLargeException = PayloadTooLargeException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Precondition Failed* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class PreconditionFailedException extends HttpException {
/**
* Instantiate a `PreconditionFailedException` Exception.
*
* @example
* `throw new PreconditionFailedException()`
*
* @usageNotes
* The HTTP response status code will be 412.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 412.
* - `message`: the string `'Precondition Failed'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PreconditionFailedException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Precondition Failed* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class PreconditionFailedException extends http_exception_1.HttpException {
/**
* Instantiate a `PreconditionFailedException` Exception.
*
* @example
* `throw new PreconditionFailedException()`
*
* @usageNotes
* The HTTP response status code will be 412.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 412.
* - `message`: the string `'Precondition Failed'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Precondition Failed') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.PRECONDITION_FAILED), http_status_enum_1.HttpStatus.PRECONDITION_FAILED, httpExceptionOptions);
}
}
exports.PreconditionFailedException = PreconditionFailedException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Request Timeout* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class RequestTimeoutException extends HttpException {
/**
* Instantiate a `RequestTimeoutException` Exception.
*
* @example
* `throw new RequestTimeoutException()`
*
* @usageNotes
* The HTTP response status code will be 408.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 408.
* - `message`: the string `'Request Timeout'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RequestTimeoutException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Request Timeout* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class RequestTimeoutException extends http_exception_1.HttpException {
/**
* Instantiate a `RequestTimeoutException` Exception.
*
* @example
* `throw new RequestTimeoutException()`
*
* @usageNotes
* The HTTP response status code will be 408.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 408.
* - `message`: the string `'Request Timeout'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Request Timeout') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.REQUEST_TIMEOUT), http_status_enum_1.HttpStatus.REQUEST_TIMEOUT, httpExceptionOptions);
}
}
exports.RequestTimeoutException = RequestTimeoutException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Service Unavailable* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class ServiceUnavailableException extends HttpException {
/**
* Instantiate a `ServiceUnavailableException` Exception.
*
* @example
* `throw new ServiceUnavailableException()`
*
* @usageNotes
* The HTTP response status code will be 503.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 503.
* - `message`: the string `'Service Unavailable'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServiceUnavailableException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Service Unavailable* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class ServiceUnavailableException extends http_exception_1.HttpException {
/**
* Instantiate a `ServiceUnavailableException` Exception.
*
* @example
* `throw new ServiceUnavailableException()`
*
* @usageNotes
* The HTTP response status code will be 503.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 503.
* - `message`: the string `'Service Unavailable'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Service Unavailable') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.SERVICE_UNAVAILABLE), http_status_enum_1.HttpStatus.SERVICE_UNAVAILABLE, httpExceptionOptions);
}
}
exports.ServiceUnavailableException = ServiceUnavailableException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Unauthorized* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class UnauthorizedException extends HttpException {
/**
* Instantiate an `UnauthorizedException` Exception.
*
* @example
* `throw new UnauthorizedException()`
*
* @usageNotes
* The HTTP response status code will be 401.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 401.
* - `message`: the string `'Unauthorized'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnauthorizedException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Unauthorized* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class UnauthorizedException extends http_exception_1.HttpException {
/**
* Instantiate an `UnauthorizedException` Exception.
*
* @example
* `throw new UnauthorizedException()`
*
* @usageNotes
* The HTTP response status code will be 401.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 401.
* - `message`: the string `'Unauthorized'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Unauthorized') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.UNAUTHORIZED), http_status_enum_1.HttpStatus.UNAUTHORIZED, httpExceptionOptions);
}
}
exports.UnauthorizedException = UnauthorizedException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Unprocessable Entity* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class UnprocessableEntityException extends HttpException {
/**
* Instantiate an `UnprocessableEntityException` Exception.
*
* @example
* `throw new UnprocessableEntityException()`
*
* @usageNotes
* The HTTP response status code will be 422.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 422.
* - `message`: the string `'Unprocessable Entity'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnprocessableEntityException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Unprocessable Entity* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class UnprocessableEntityException extends http_exception_1.HttpException {
/**
* Instantiate an `UnprocessableEntityException` Exception.
*
* @example
* `throw new UnprocessableEntityException()`
*
* @usageNotes
* The HTTP response status code will be 422.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 422.
* - `message`: the string `'Unprocessable Entity'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Unprocessable Entity') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.UNPROCESSABLE_ENTITY), http_status_enum_1.HttpStatus.UNPROCESSABLE_ENTITY, httpExceptionOptions);
}
}
exports.UnprocessableEntityException = UnprocessableEntityException;

View File

@@ -0,0 +1,35 @@
import { HttpException, HttpExceptionOptions } from './http.exception';
/**
* Defines an HTTP exception for *Unsupported Media Type* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
export declare class UnsupportedMediaTypeException extends HttpException {
/**
* Instantiate an `UnsupportedMediaTypeException` Exception.
*
* @example
* `throw new UnsupportedMediaTypeException()`
*
* @usageNotes
* The HTTP response status code will be 415.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 415.
* - `message`: the string `'Unsupported Media Type'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError?: any, descriptionOrOptions?: string | HttpExceptionOptions);
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnsupportedMediaTypeException = void 0;
const http_status_enum_1 = require("../enums/http-status.enum");
const http_exception_1 = require("./http.exception");
/**
* Defines an HTTP exception for *Unsupported Media Type* type errors.
*
* @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
*
* @publicApi
*/
class UnsupportedMediaTypeException extends http_exception_1.HttpException {
/**
* Instantiate an `UnsupportedMediaTypeException` Exception.
*
* @example
* `throw new UnsupportedMediaTypeException()`
*
* @usageNotes
* The HTTP response status code will be 415.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 415.
* - `message`: the string `'Unsupported Media Type'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
*/
constructor(objectOrError, descriptionOrOptions = 'Unsupported Media Type') {
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.UNSUPPORTED_MEDIA_TYPE), http_status_enum_1.HttpStatus.UNSUPPORTED_MEDIA_TYPE, httpExceptionOptions);
}
}
exports.UnsupportedMediaTypeException = UnsupportedMediaTypeException;