@nestjs/common 9.1.5 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +3 -1
- package/cache/cache.providers.js +14 -8
- package/cache/interfaces/cache-manager.interface.d.ts +4 -3
- package/exceptions/bad-gateway.exception.d.ts +4 -4
- package/exceptions/bad-gateway.exception.js +5 -4
- package/exceptions/bad-request.exception.d.ts +4 -4
- package/exceptions/bad-request.exception.js +5 -4
- package/exceptions/conflict.exception.d.ts +4 -4
- package/exceptions/conflict.exception.js +5 -4
- package/exceptions/forbidden.exception.d.ts +4 -4
- package/exceptions/forbidden.exception.js +5 -4
- package/exceptions/gateway-timeout.exception.d.ts +4 -4
- package/exceptions/gateway-timeout.exception.js +5 -4
- package/exceptions/gone.exception.d.ts +4 -4
- package/exceptions/gone.exception.js +5 -4
- package/exceptions/http-version-not-supported.exception.d.ts +4 -4
- package/exceptions/http-version-not-supported.exception.js +5 -4
- package/exceptions/http.exception.d.ts +33 -5
- package/exceptions/http.exception.js +54 -9
- package/exceptions/im-a-teapot.exception.d.ts +4 -4
- package/exceptions/im-a-teapot.exception.js +5 -4
- package/exceptions/internal-server-error.exception.d.ts +4 -4
- package/exceptions/internal-server-error.exception.js +5 -4
- package/exceptions/method-not-allowed.exception.d.ts +4 -4
- package/exceptions/method-not-allowed.exception.js +5 -4
- package/exceptions/misdirected.exception.d.ts +4 -4
- package/exceptions/misdirected.exception.js +5 -4
- package/exceptions/not-acceptable.exception.d.ts +4 -4
- package/exceptions/not-acceptable.exception.js +5 -4
- package/exceptions/not-found.exception.d.ts +4 -4
- package/exceptions/not-found.exception.js +5 -4
- package/exceptions/not-implemented.exception.d.ts +4 -4
- package/exceptions/not-implemented.exception.js +5 -4
- package/exceptions/payload-too-large.exception.d.ts +4 -4
- package/exceptions/payload-too-large.exception.js +5 -4
- package/exceptions/precondition-failed.exception.d.ts +4 -4
- package/exceptions/precondition-failed.exception.js +5 -4
- package/exceptions/request-timeout.exception.d.ts +4 -4
- package/exceptions/request-timeout.exception.js +5 -4
- package/exceptions/service-unavailable.exception.d.ts +4 -4
- package/exceptions/service-unavailable.exception.js +5 -4
- package/exceptions/unauthorized.exception.d.ts +4 -4
- package/exceptions/unauthorized.exception.js +5 -4
- package/exceptions/unprocessable-entity.exception.d.ts +4 -4
- package/exceptions/unprocessable-entity.exception.js +5 -4
- package/exceptions/unsupported-media-type.exception.d.ts +4 -4
- package/exceptions/unsupported-media-type.exception.js +5 -4
- package/interfaces/middleware/middleware-configuration.interface.d.ts +2 -0
- package/interfaces/nest-application-context.interface.d.ts +66 -4
- package/interfaces/nest-application-options.interface.d.ts +5 -0
- package/package.json +2 -2
- package/pipes/file/parse-file-pipe.builder.d.ts +2 -0
- package/pipes/file/parse-file-pipe.builder.js +5 -3
- package/services/console-logger.service.d.ts +2 -0
- package/services/console-logger.service.js +12 -7
|
@@ -23,7 +23,7 @@ class ImATeapotException extends http_exception_1.HttpException {
|
|
|
23
23
|
* @usageNotes
|
|
24
24
|
* The HTTP response status code will be 418.
|
|
25
25
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
26
|
-
* - The `
|
|
26
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
27
27
|
*
|
|
28
28
|
* By default, the JSON response body contains two properties:
|
|
29
29
|
* - `statusCode`: this will be the value 418.
|
|
@@ -36,10 +36,11 @@ class ImATeapotException extends http_exception_1.HttpException {
|
|
|
36
36
|
* and return it as the JSON response body.
|
|
37
37
|
*
|
|
38
38
|
* @param objectOrError string or object describing the error condition.
|
|
39
|
-
* @param
|
|
39
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
40
40
|
*/
|
|
41
|
-
constructor(objectOrError,
|
|
42
|
-
|
|
41
|
+
constructor(objectOrError, descriptionOrOptions = `I'm a teapot`) {
|
|
42
|
+
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
43
|
+
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);
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
exports.ImATeapotException = ImATeapotException;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpException } from './http.exception';
|
|
1
|
+
import { HttpException, HttpExceptionOptions } from './http.exception';
|
|
2
2
|
/**
|
|
3
3
|
* Defines an HTTP exception for *Internal Server Error* type errors.
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@ export declare class InternalServerErrorException extends HttpException {
|
|
|
16
16
|
* @usageNotes
|
|
17
17
|
* The HTTP response status code will be 500.
|
|
18
18
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
19
|
-
* - The `
|
|
19
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
20
20
|
*
|
|
21
21
|
* By default, the JSON response body contains two properties:
|
|
22
22
|
* - `statusCode`: this will be the value 500.
|
|
@@ -29,7 +29,7 @@ export declare class InternalServerErrorException extends HttpException {
|
|
|
29
29
|
* and return it as the JSON response body.
|
|
30
30
|
*
|
|
31
31
|
* @param objectOrError string or object describing the error condition.
|
|
32
|
-
* @param
|
|
32
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
33
33
|
*/
|
|
34
|
-
constructor(objectOrError?: string | object | any,
|
|
34
|
+
constructor(objectOrError?: string | object | any, descriptionOrOptions?: string | HttpExceptionOptions);
|
|
35
35
|
}
|
|
@@ -20,7 +20,7 @@ class InternalServerErrorException extends http_exception_1.HttpException {
|
|
|
20
20
|
* @usageNotes
|
|
21
21
|
* The HTTP response status code will be 500.
|
|
22
22
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
23
|
-
* - The `
|
|
23
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
24
24
|
*
|
|
25
25
|
* By default, the JSON response body contains two properties:
|
|
26
26
|
* - `statusCode`: this will be the value 500.
|
|
@@ -33,10 +33,11 @@ class InternalServerErrorException extends http_exception_1.HttpException {
|
|
|
33
33
|
* and return it as the JSON response body.
|
|
34
34
|
*
|
|
35
35
|
* @param objectOrError string or object describing the error condition.
|
|
36
|
-
* @param
|
|
36
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
37
37
|
*/
|
|
38
|
-
constructor(objectOrError,
|
|
39
|
-
|
|
38
|
+
constructor(objectOrError, descriptionOrOptions = 'Internal Server Error') {
|
|
39
|
+
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
40
|
+
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);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.InternalServerErrorException = InternalServerErrorException;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpException } from './http.exception';
|
|
1
|
+
import { HttpException, HttpExceptionOptions } from './http.exception';
|
|
2
2
|
/**
|
|
3
3
|
* Defines an HTTP exception for *Method Not Allowed* type errors.
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@ export declare class MethodNotAllowedException extends HttpException {
|
|
|
16
16
|
* @usageNotes
|
|
17
17
|
* The HTTP response status code will be 405.
|
|
18
18
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
19
|
-
* - The `
|
|
19
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
20
20
|
*
|
|
21
21
|
* By default, the JSON response body contains two properties:
|
|
22
22
|
* - `statusCode`: this will be the value 405.
|
|
@@ -29,7 +29,7 @@ export declare class MethodNotAllowedException extends HttpException {
|
|
|
29
29
|
* and return it as the JSON response body.
|
|
30
30
|
*
|
|
31
31
|
* @param objectOrError string or object describing the error condition.
|
|
32
|
-
* @param
|
|
32
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
33
33
|
*/
|
|
34
|
-
constructor(objectOrError?: string | object | any,
|
|
34
|
+
constructor(objectOrError?: string | object | any, descriptionOrOptions?: string | HttpExceptionOptions);
|
|
35
35
|
}
|
|
@@ -20,7 +20,7 @@ class MethodNotAllowedException extends http_exception_1.HttpException {
|
|
|
20
20
|
* @usageNotes
|
|
21
21
|
* The HTTP response status code will be 405.
|
|
22
22
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
23
|
-
* - The `
|
|
23
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
24
24
|
*
|
|
25
25
|
* By default, the JSON response body contains two properties:
|
|
26
26
|
* - `statusCode`: this will be the value 405.
|
|
@@ -33,10 +33,11 @@ class MethodNotAllowedException extends http_exception_1.HttpException {
|
|
|
33
33
|
* and return it as the JSON response body.
|
|
34
34
|
*
|
|
35
35
|
* @param objectOrError string or object describing the error condition.
|
|
36
|
-
* @param
|
|
36
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
37
37
|
*/
|
|
38
|
-
constructor(objectOrError,
|
|
39
|
-
|
|
38
|
+
constructor(objectOrError, descriptionOrOptions = 'Method Not Allowed') {
|
|
39
|
+
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
40
|
+
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);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.MethodNotAllowedException = MethodNotAllowedException;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpException } from './http.exception';
|
|
1
|
+
import { HttpException, HttpExceptionOptions } from './http.exception';
|
|
2
2
|
/**
|
|
3
3
|
* Defines an HTTP exception for *Misdirected* type errors.
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@ export declare class MisdirectedException extends HttpException {
|
|
|
16
16
|
* @usageNotes
|
|
17
17
|
* The HTTP response status code will be 421.
|
|
18
18
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
19
|
-
* - The `
|
|
19
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
20
20
|
*
|
|
21
21
|
* By default, the JSON response body contains two properties:
|
|
22
22
|
* - `statusCode`: this will be the value 421.
|
|
@@ -29,7 +29,7 @@ export declare class MisdirectedException extends HttpException {
|
|
|
29
29
|
* and return it as the JSON response body.
|
|
30
30
|
*
|
|
31
31
|
* @param objectOrError string or object describing the error condition.
|
|
32
|
-
* @param
|
|
32
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
33
33
|
*/
|
|
34
|
-
constructor(objectOrError?: string | object | any,
|
|
34
|
+
constructor(objectOrError?: string | object | any, descriptionOrOptions?: string | HttpExceptionOptions);
|
|
35
35
|
}
|
|
@@ -20,7 +20,7 @@ class MisdirectedException extends http_exception_1.HttpException {
|
|
|
20
20
|
* @usageNotes
|
|
21
21
|
* The HTTP response status code will be 421.
|
|
22
22
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
23
|
-
* - The `
|
|
23
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
24
24
|
*
|
|
25
25
|
* By default, the JSON response body contains two properties:
|
|
26
26
|
* - `statusCode`: this will be the value 421.
|
|
@@ -33,10 +33,11 @@ class MisdirectedException extends http_exception_1.HttpException {
|
|
|
33
33
|
* and return it as the JSON response body.
|
|
34
34
|
*
|
|
35
35
|
* @param objectOrError string or object describing the error condition.
|
|
36
|
-
* @param
|
|
36
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
37
37
|
*/
|
|
38
|
-
constructor(objectOrError,
|
|
39
|
-
|
|
38
|
+
constructor(objectOrError, descriptionOrOptions = 'Misdirected') {
|
|
39
|
+
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
40
|
+
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.MISDIRECTED), http_status_enum_1.HttpStatus.MISDIRECTED, httpExceptionOptions);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.MisdirectedException = MisdirectedException;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpException } from './http.exception';
|
|
1
|
+
import { HttpException, HttpExceptionOptions } from './http.exception';
|
|
2
2
|
/**
|
|
3
3
|
* Defines an HTTP exception for *Not Acceptable* type errors.
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@ export declare class NotAcceptableException extends HttpException {
|
|
|
16
16
|
* @usageNotes
|
|
17
17
|
* The HTTP response status code will be 406.
|
|
18
18
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
19
|
-
* - The `
|
|
19
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
20
20
|
*
|
|
21
21
|
* By default, the JSON response body contains two properties:
|
|
22
22
|
* - `statusCode`: this will be the value 406.
|
|
@@ -29,7 +29,7 @@ export declare class NotAcceptableException extends HttpException {
|
|
|
29
29
|
* and return it as the JSON response body.
|
|
30
30
|
*
|
|
31
31
|
* @param objectOrError string or object describing the error condition.
|
|
32
|
-
* @param
|
|
32
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
33
33
|
*/
|
|
34
|
-
constructor(objectOrError?: string | object | any,
|
|
34
|
+
constructor(objectOrError?: string | object | any, descriptionOrOptions?: string | HttpExceptionOptions);
|
|
35
35
|
}
|
|
@@ -20,7 +20,7 @@ class NotAcceptableException extends http_exception_1.HttpException {
|
|
|
20
20
|
* @usageNotes
|
|
21
21
|
* The HTTP response status code will be 406.
|
|
22
22
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
23
|
-
* - The `
|
|
23
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
24
24
|
*
|
|
25
25
|
* By default, the JSON response body contains two properties:
|
|
26
26
|
* - `statusCode`: this will be the value 406.
|
|
@@ -33,10 +33,11 @@ class NotAcceptableException extends http_exception_1.HttpException {
|
|
|
33
33
|
* and return it as the JSON response body.
|
|
34
34
|
*
|
|
35
35
|
* @param objectOrError string or object describing the error condition.
|
|
36
|
-
* @param
|
|
36
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
37
37
|
*/
|
|
38
|
-
constructor(objectOrError,
|
|
39
|
-
|
|
38
|
+
constructor(objectOrError, descriptionOrOptions = 'Not Acceptable') {
|
|
39
|
+
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
40
|
+
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.NOT_ACCEPTABLE), http_status_enum_1.HttpStatus.NOT_ACCEPTABLE, httpExceptionOptions);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.NotAcceptableException = NotAcceptableException;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpException } from './http.exception';
|
|
1
|
+
import { HttpException, HttpExceptionOptions } from './http.exception';
|
|
2
2
|
/**
|
|
3
3
|
* Defines an HTTP exception for *Not Found* type errors.
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@ export declare class NotFoundException extends HttpException {
|
|
|
16
16
|
* @usageNotes
|
|
17
17
|
* The HTTP response status code will be 404.
|
|
18
18
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
19
|
-
* - The `
|
|
19
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
20
20
|
*
|
|
21
21
|
* By default, the JSON response body contains two properties:
|
|
22
22
|
* - `statusCode`: this will be the value 404.
|
|
@@ -29,7 +29,7 @@ export declare class NotFoundException extends HttpException {
|
|
|
29
29
|
* and return it as the JSON response body.
|
|
30
30
|
*
|
|
31
31
|
* @param objectOrError string or object describing the error condition.
|
|
32
|
-
* @param
|
|
32
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
33
33
|
*/
|
|
34
|
-
constructor(objectOrError?: string | object | any,
|
|
34
|
+
constructor(objectOrError?: string | object | any, descriptionOrOptions?: string | HttpExceptionOptions);
|
|
35
35
|
}
|
|
@@ -20,7 +20,7 @@ class NotFoundException extends http_exception_1.HttpException {
|
|
|
20
20
|
* @usageNotes
|
|
21
21
|
* The HTTP response status code will be 404.
|
|
22
22
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
23
|
-
* - The `
|
|
23
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
24
24
|
*
|
|
25
25
|
* By default, the JSON response body contains two properties:
|
|
26
26
|
* - `statusCode`: this will be the value 404.
|
|
@@ -33,10 +33,11 @@ class NotFoundException extends http_exception_1.HttpException {
|
|
|
33
33
|
* and return it as the JSON response body.
|
|
34
34
|
*
|
|
35
35
|
* @param objectOrError string or object describing the error condition.
|
|
36
|
-
* @param
|
|
36
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
37
37
|
*/
|
|
38
|
-
constructor(objectOrError,
|
|
39
|
-
|
|
38
|
+
constructor(objectOrError, descriptionOrOptions = 'Not Found') {
|
|
39
|
+
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
40
|
+
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.NOT_FOUND), http_status_enum_1.HttpStatus.NOT_FOUND, httpExceptionOptions);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.NotFoundException = NotFoundException;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpException } from './http.exception';
|
|
1
|
+
import { HttpException, HttpExceptionOptions } from './http.exception';
|
|
2
2
|
/**
|
|
3
3
|
* Defines an HTTP exception for *Not Implemented* type errors.
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@ export declare class NotImplementedException extends HttpException {
|
|
|
16
16
|
* @usageNotes
|
|
17
17
|
* The HTTP response status code will be 501.
|
|
18
18
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
19
|
-
* - The `
|
|
19
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
20
20
|
*
|
|
21
21
|
* By default, the JSON response body contains two properties:
|
|
22
22
|
* - `statusCode`: this will be the value 501.
|
|
@@ -28,8 +28,8 @@ export declare class NotImplementedException extends HttpException {
|
|
|
28
28
|
* entire JSON response body, pass an object instead. Nest will serialize the object
|
|
29
29
|
* and return it as the JSON response body.
|
|
30
30
|
*
|
|
31
|
-
* @param description
|
|
31
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
32
32
|
* @param error a short description of the HTTP error.
|
|
33
33
|
*/
|
|
34
|
-
constructor(objectOrError?: string | object | any,
|
|
34
|
+
constructor(objectOrError?: string | object | any, descriptionOrOptions?: string | HttpExceptionOptions);
|
|
35
35
|
}
|
|
@@ -20,7 +20,7 @@ class NotImplementedException extends http_exception_1.HttpException {
|
|
|
20
20
|
* @usageNotes
|
|
21
21
|
* The HTTP response status code will be 501.
|
|
22
22
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
23
|
-
* - The `
|
|
23
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
24
24
|
*
|
|
25
25
|
* By default, the JSON response body contains two properties:
|
|
26
26
|
* - `statusCode`: this will be the value 501.
|
|
@@ -32,11 +32,12 @@ class NotImplementedException extends http_exception_1.HttpException {
|
|
|
32
32
|
* entire JSON response body, pass an object instead. Nest will serialize the object
|
|
33
33
|
* and return it as the JSON response body.
|
|
34
34
|
*
|
|
35
|
-
* @param description
|
|
35
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
36
36
|
* @param error a short description of the HTTP error.
|
|
37
37
|
*/
|
|
38
|
-
constructor(objectOrError,
|
|
39
|
-
|
|
38
|
+
constructor(objectOrError, descriptionOrOptions = 'Not Implemented') {
|
|
39
|
+
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
40
|
+
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.NOT_IMPLEMENTED), http_status_enum_1.HttpStatus.NOT_IMPLEMENTED, httpExceptionOptions);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.NotImplementedException = NotImplementedException;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpException } from './http.exception';
|
|
1
|
+
import { HttpException, HttpExceptionOptions } from './http.exception';
|
|
2
2
|
/**
|
|
3
3
|
* Defines an HTTP exception for *Payload Too Large* type errors.
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@ export declare class PayloadTooLargeException extends HttpException {
|
|
|
16
16
|
* @usageNotes
|
|
17
17
|
* The HTTP response status code will be 413.
|
|
18
18
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
19
|
-
* - The `
|
|
19
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
20
20
|
*
|
|
21
21
|
* By default, the JSON response body contains two properties:
|
|
22
22
|
* - `statusCode`: this will be the value 413.
|
|
@@ -29,7 +29,7 @@ export declare class PayloadTooLargeException extends HttpException {
|
|
|
29
29
|
* and return it as the JSON response body.
|
|
30
30
|
*
|
|
31
31
|
* @param objectOrError string or object describing the error condition.
|
|
32
|
-
* @param
|
|
32
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
33
33
|
*/
|
|
34
|
-
constructor(objectOrError?: string | object | any,
|
|
34
|
+
constructor(objectOrError?: string | object | any, descriptionOrOptions?: string | HttpExceptionOptions);
|
|
35
35
|
}
|
|
@@ -20,7 +20,7 @@ class PayloadTooLargeException extends http_exception_1.HttpException {
|
|
|
20
20
|
* @usageNotes
|
|
21
21
|
* The HTTP response status code will be 413.
|
|
22
22
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
23
|
-
* - The `
|
|
23
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
24
24
|
*
|
|
25
25
|
* By default, the JSON response body contains two properties:
|
|
26
26
|
* - `statusCode`: this will be the value 413.
|
|
@@ -33,10 +33,11 @@ class PayloadTooLargeException extends http_exception_1.HttpException {
|
|
|
33
33
|
* and return it as the JSON response body.
|
|
34
34
|
*
|
|
35
35
|
* @param objectOrError string or object describing the error condition.
|
|
36
|
-
* @param
|
|
36
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
37
37
|
*/
|
|
38
|
-
constructor(objectOrError,
|
|
39
|
-
|
|
38
|
+
constructor(objectOrError, descriptionOrOptions = 'Payload Too Large') {
|
|
39
|
+
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
40
|
+
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);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.PayloadTooLargeException = PayloadTooLargeException;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpException } from './http.exception';
|
|
1
|
+
import { HttpException, HttpExceptionOptions } from './http.exception';
|
|
2
2
|
/**
|
|
3
3
|
* Defines an HTTP exception for *Precondition Failed* type errors.
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@ export declare class PreconditionFailedException extends HttpException {
|
|
|
16
16
|
* @usageNotes
|
|
17
17
|
* The HTTP response status code will be 412.
|
|
18
18
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
19
|
-
* - The `
|
|
19
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
20
20
|
*
|
|
21
21
|
* By default, the JSON response body contains two properties:
|
|
22
22
|
* - `statusCode`: this will be the value 412.
|
|
@@ -29,7 +29,7 @@ export declare class PreconditionFailedException extends HttpException {
|
|
|
29
29
|
* and return it as the JSON response body.
|
|
30
30
|
*
|
|
31
31
|
* @param objectOrError string or object describing the error condition.
|
|
32
|
-
* @param
|
|
32
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
33
33
|
*/
|
|
34
|
-
constructor(objectOrError?: string | object | any,
|
|
34
|
+
constructor(objectOrError?: string | object | any, descriptionOrOptions?: string | HttpExceptionOptions);
|
|
35
35
|
}
|
|
@@ -20,7 +20,7 @@ class PreconditionFailedException extends http_exception_1.HttpException {
|
|
|
20
20
|
* @usageNotes
|
|
21
21
|
* The HTTP response status code will be 412.
|
|
22
22
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
23
|
-
* - The `
|
|
23
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
24
24
|
*
|
|
25
25
|
* By default, the JSON response body contains two properties:
|
|
26
26
|
* - `statusCode`: this will be the value 412.
|
|
@@ -33,10 +33,11 @@ class PreconditionFailedException extends http_exception_1.HttpException {
|
|
|
33
33
|
* and return it as the JSON response body.
|
|
34
34
|
*
|
|
35
35
|
* @param objectOrError string or object describing the error condition.
|
|
36
|
-
* @param
|
|
36
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
37
37
|
*/
|
|
38
|
-
constructor(objectOrError,
|
|
39
|
-
|
|
38
|
+
constructor(objectOrError, descriptionOrOptions = 'Precondition Failed') {
|
|
39
|
+
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
40
|
+
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.PRECONDITION_FAILED), http_status_enum_1.HttpStatus.PRECONDITION_FAILED, httpExceptionOptions);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.PreconditionFailedException = PreconditionFailedException;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpException } from './http.exception';
|
|
1
|
+
import { HttpException, HttpExceptionOptions } from './http.exception';
|
|
2
2
|
/**
|
|
3
3
|
* Defines an HTTP exception for *Request Timeout* type errors.
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@ export declare class RequestTimeoutException extends HttpException {
|
|
|
16
16
|
* @usageNotes
|
|
17
17
|
* The HTTP response status code will be 408.
|
|
18
18
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
19
|
-
* - The `
|
|
19
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
20
20
|
*
|
|
21
21
|
* By default, the JSON response body contains two properties:
|
|
22
22
|
* - `statusCode`: this will be the value 408.
|
|
@@ -29,7 +29,7 @@ export declare class RequestTimeoutException extends HttpException {
|
|
|
29
29
|
* and return it as the JSON response body.
|
|
30
30
|
*
|
|
31
31
|
* @param objectOrError string or object describing the error condition.
|
|
32
|
-
* @param
|
|
32
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
33
33
|
*/
|
|
34
|
-
constructor(objectOrError?: string | object | any,
|
|
34
|
+
constructor(objectOrError?: string | object | any, descriptionOrOptions?: string | HttpExceptionOptions);
|
|
35
35
|
}
|
|
@@ -20,7 +20,7 @@ class RequestTimeoutException extends http_exception_1.HttpException {
|
|
|
20
20
|
* @usageNotes
|
|
21
21
|
* The HTTP response status code will be 408.
|
|
22
22
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
23
|
-
* - The `
|
|
23
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
24
24
|
*
|
|
25
25
|
* By default, the JSON response body contains two properties:
|
|
26
26
|
* - `statusCode`: this will be the value 408.
|
|
@@ -33,10 +33,11 @@ class RequestTimeoutException extends http_exception_1.HttpException {
|
|
|
33
33
|
* and return it as the JSON response body.
|
|
34
34
|
*
|
|
35
35
|
* @param objectOrError string or object describing the error condition.
|
|
36
|
-
* @param
|
|
36
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
37
37
|
*/
|
|
38
|
-
constructor(objectOrError,
|
|
39
|
-
|
|
38
|
+
constructor(objectOrError, descriptionOrOptions = 'Request Timeout') {
|
|
39
|
+
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
40
|
+
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.REQUEST_TIMEOUT), http_status_enum_1.HttpStatus.REQUEST_TIMEOUT, httpExceptionOptions);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.RequestTimeoutException = RequestTimeoutException;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpException } from './http.exception';
|
|
1
|
+
import { HttpException, HttpExceptionOptions } from './http.exception';
|
|
2
2
|
/**
|
|
3
3
|
* Defines an HTTP exception for *Service Unavailable* type errors.
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@ export declare class ServiceUnavailableException extends HttpException {
|
|
|
16
16
|
* @usageNotes
|
|
17
17
|
* The HTTP response status code will be 503.
|
|
18
18
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
19
|
-
* - The `
|
|
19
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
20
20
|
*
|
|
21
21
|
* By default, the JSON response body contains two properties:
|
|
22
22
|
* - `statusCode`: this will be the value 503.
|
|
@@ -29,7 +29,7 @@ export declare class ServiceUnavailableException extends HttpException {
|
|
|
29
29
|
* and return it as the JSON response body.
|
|
30
30
|
*
|
|
31
31
|
* @param objectOrError string or object describing the error condition.
|
|
32
|
-
* @param
|
|
32
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
33
33
|
*/
|
|
34
|
-
constructor(objectOrError?: string | object | any,
|
|
34
|
+
constructor(objectOrError?: string | object | any, descriptionOrOptions?: string | HttpExceptionOptions);
|
|
35
35
|
}
|
|
@@ -20,7 +20,7 @@ class ServiceUnavailableException extends http_exception_1.HttpException {
|
|
|
20
20
|
* @usageNotes
|
|
21
21
|
* The HTTP response status code will be 503.
|
|
22
22
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
23
|
-
* - The `
|
|
23
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
24
24
|
*
|
|
25
25
|
* By default, the JSON response body contains two properties:
|
|
26
26
|
* - `statusCode`: this will be the value 503.
|
|
@@ -33,10 +33,11 @@ class ServiceUnavailableException extends http_exception_1.HttpException {
|
|
|
33
33
|
* and return it as the JSON response body.
|
|
34
34
|
*
|
|
35
35
|
* @param objectOrError string or object describing the error condition.
|
|
36
|
-
* @param
|
|
36
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
37
37
|
*/
|
|
38
|
-
constructor(objectOrError,
|
|
39
|
-
|
|
38
|
+
constructor(objectOrError, descriptionOrOptions = 'Service Unavailable') {
|
|
39
|
+
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
40
|
+
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.SERVICE_UNAVAILABLE), http_status_enum_1.HttpStatus.SERVICE_UNAVAILABLE, httpExceptionOptions);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.ServiceUnavailableException = ServiceUnavailableException;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpException } from './http.exception';
|
|
1
|
+
import { HttpException, HttpExceptionOptions } from './http.exception';
|
|
2
2
|
/**
|
|
3
3
|
* Defines an HTTP exception for *Unauthorized* type errors.
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@ export declare class UnauthorizedException extends HttpException {
|
|
|
16
16
|
* @usageNotes
|
|
17
17
|
* The HTTP response status code will be 401.
|
|
18
18
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
19
|
-
* - The `
|
|
19
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
20
20
|
*
|
|
21
21
|
* By default, the JSON response body contains two properties:
|
|
22
22
|
* - `statusCode`: this will be the value 401.
|
|
@@ -29,7 +29,7 @@ export declare class UnauthorizedException extends HttpException {
|
|
|
29
29
|
* and return it as the JSON response body.
|
|
30
30
|
*
|
|
31
31
|
* @param objectOrError string or object describing the error condition.
|
|
32
|
-
* @param
|
|
32
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
33
33
|
*/
|
|
34
|
-
constructor(objectOrError?: string | object | any,
|
|
34
|
+
constructor(objectOrError?: string | object | any, descriptionOrOptions?: string | HttpExceptionOptions);
|
|
35
35
|
}
|
|
@@ -20,7 +20,7 @@ class UnauthorizedException extends http_exception_1.HttpException {
|
|
|
20
20
|
* @usageNotes
|
|
21
21
|
* The HTTP response status code will be 401.
|
|
22
22
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
23
|
-
* - The `
|
|
23
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
24
24
|
*
|
|
25
25
|
* By default, the JSON response body contains two properties:
|
|
26
26
|
* - `statusCode`: this will be the value 401.
|
|
@@ -33,10 +33,11 @@ class UnauthorizedException extends http_exception_1.HttpException {
|
|
|
33
33
|
* and return it as the JSON response body.
|
|
34
34
|
*
|
|
35
35
|
* @param objectOrError string or object describing the error condition.
|
|
36
|
-
* @param
|
|
36
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
37
37
|
*/
|
|
38
|
-
constructor(objectOrError,
|
|
39
|
-
|
|
38
|
+
constructor(objectOrError, descriptionOrOptions = 'Unauthorized') {
|
|
39
|
+
const { description, httpExceptionOptions } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
40
|
+
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.UNAUTHORIZED), http_status_enum_1.HttpStatus.UNAUTHORIZED, httpExceptionOptions);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.UnauthorizedException = UnauthorizedException;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpException } from './http.exception';
|
|
1
|
+
import { HttpException, HttpExceptionOptions } from './http.exception';
|
|
2
2
|
/**
|
|
3
3
|
* Defines an HTTP exception for *Unprocessable Entity* type errors.
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@ export declare class UnprocessableEntityException extends HttpException {
|
|
|
16
16
|
* @usageNotes
|
|
17
17
|
* The HTTP response status code will be 422.
|
|
18
18
|
* - The `objectOrError` argument defines the JSON response body or the message string.
|
|
19
|
-
* - The `
|
|
19
|
+
* - The `descriptionOrOptions` argument contains either a short description of the HTTP error or an options object used to provide an underlying error cause.
|
|
20
20
|
*
|
|
21
21
|
* By default, the JSON response body contains two properties:
|
|
22
22
|
* - `statusCode`: this will be the value 422.
|
|
@@ -29,7 +29,7 @@ export declare class UnprocessableEntityException extends HttpException {
|
|
|
29
29
|
* and return it as the JSON response body.
|
|
30
30
|
*
|
|
31
31
|
* @param objectOrError string or object describing the error condition.
|
|
32
|
-
* @param
|
|
32
|
+
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
33
33
|
*/
|
|
34
|
-
constructor(objectOrError?: string | object | any,
|
|
34
|
+
constructor(objectOrError?: string | object | any, descriptionOrOptions?: string | HttpExceptionOptions);
|
|
35
35
|
}
|