# Exception Class
Module | import { Exception } from "@tsed/exceptions" |
---|---|
Source | /packages/exceptions/src/core/Exception.ts |
# Overview
class Exception extends Error {
/**
* Exception base name
* @type {string}
*/
name: string;
/**
* Message of the exception
*/
message: string;
/**
* Exception type
* @type {string}
*/
type: string;
/**
* Stack calling
*/
stack: string;
origin: Error & any;
/**
* HTTP Code Status
*/
status: number;
/**
*
*/
body: any;
/**
* Headers must be sent to the response
*/
headers: {
[key: string]: any;
};
[key: string]: any;
constructor(status?: number, message?: string, origin?: Error | string | any);
setHeaders(headers: {
[key: string]: any;
}): this;
setHeader(key: string, value: any): this;
setOrigin(origin: Error | string | any): void;
toString(): string;
}
# Members
name: string;
Exception base name
message: string;
Message of the exception
type: string;
Exception type
stack: string;
Stack calling
origin: Error & any;
status: number;
HTTP Code Status
body: any;
headers: {
[key: string]: any;
};
Headers must be sent to the response
[key: string]: any;
setHeaders(headers: {
[key: string]: any;
}): this;
setHeader(key: string, value: any): this;
setOrigin(origin: Error | string | any): void;
toString(): string;
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Jest
- Seq
- Controllers
- Providers
- Model
- Converters
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing