File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/frameworks/shared/exceptions Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { HttpException , HttpStatus } from '@nestjs/common' ;
2
2
import { IErrorResponse } from '../responses/error.response' ;
3
-
3
+ /**
4
+ * BaseException is a custom exception class extending NestJS's HttpException.
5
+ * It allows attaching a custom error code and additional parameters to the error response.
6
+ */
4
7
export class BaseException extends HttpException {
8
+ /**
9
+ * Creates a new instance of BaseException.
10
+ * @param httpStatus - The HTTP status code to be returned.
11
+ * @param code - A custom application-specific error code.
12
+ * @param message - A human-readable error message.
13
+ * @param params - Optional additional parameters relevant to the error.
14
+ */
5
15
constructor (
6
16
public httpStatus : HttpStatus ,
7
17
private code : string ,
You can’t perform that action at this time.
0 commit comments