mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
bugfix(common): fix breaking change on http exception
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { isObject } from '../utils/shared.utils';
|
||||
|
||||
export class HttpException extends Error {
|
||||
public readonly message: any;
|
||||
|
||||
@@ -22,9 +20,7 @@ export class HttpException extends Error {
|
||||
private readonly status: number,
|
||||
) {
|
||||
super();
|
||||
this.message =
|
||||
(isObject(response) && (response as { message?: string }).message) ||
|
||||
response;
|
||||
this.message = response;
|
||||
}
|
||||
|
||||
public getResponse(): string | object {
|
||||
|
||||
Reference in New Issue
Block a user