Skip to content

Commit a8a39cd

Browse files
committed
fix: add comment for base exception
1 parent 5167f00 commit a8a39cd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/frameworks/shared/exceptions/base.exception.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
import { HttpException, HttpStatus } from '@nestjs/common';
22
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+
*/
47
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+
*/
515
constructor(
616
public httpStatus: HttpStatus,
717
private code: string,

0 commit comments

Comments
 (0)