Resolve PR discussion
Signed-off-by: Mihailo Vlajkovic <mihailovlajkovic98@gmail.com>
This commit is contained in:
committed by
Fredrik Adelöw
parent
f2865d6aea
commit
c27fe32467
@@ -11,13 +11,13 @@ export function assertError(value: unknown): asserts value is ErrorLike;
|
||||
// @public
|
||||
export class AuthenticationError extends CustomErrorBase {
|
||||
// (undocumented)
|
||||
name: string;
|
||||
name: 'AuthenticationError';
|
||||
}
|
||||
|
||||
// @public
|
||||
export class ConflictError extends CustomErrorBase {
|
||||
// (undocumented)
|
||||
name: string;
|
||||
name: 'ConflictError';
|
||||
}
|
||||
|
||||
// @public
|
||||
@@ -81,7 +81,7 @@ export class ForwardedError extends CustomErrorBase {
|
||||
// @public
|
||||
export class InputError extends CustomErrorBase {
|
||||
// (undocumented)
|
||||
name: string;
|
||||
name: 'InputError';
|
||||
}
|
||||
|
||||
// @public
|
||||
@@ -90,25 +90,25 @@ export function isError(value: unknown): value is ErrorLike;
|
||||
// @public
|
||||
export class NotAllowedError extends CustomErrorBase {
|
||||
// (undocumented)
|
||||
name: string;
|
||||
name: 'NotAllowedError';
|
||||
}
|
||||
|
||||
// @public
|
||||
export class NotFoundError extends CustomErrorBase {
|
||||
// (undocumented)
|
||||
name: string;
|
||||
name: 'NotFoundError';
|
||||
}
|
||||
|
||||
// @public
|
||||
export class NotImplementedError extends CustomErrorBase {
|
||||
// (undocumented)
|
||||
name: string;
|
||||
name: 'NotImplementedError';
|
||||
}
|
||||
|
||||
// @public
|
||||
export class NotModifiedError extends CustomErrorBase {
|
||||
// (undocumented)
|
||||
name: string;
|
||||
name: 'NotModifiedError';
|
||||
}
|
||||
|
||||
// @public
|
||||
|
||||
@@ -53,7 +53,10 @@ export class CustomErrorBase extends Error {
|
||||
|
||||
Error.captureStackTrace?.(this, this.constructor);
|
||||
|
||||
this.name = 'CustomErrorBase';
|
||||
if (!this.name) {
|
||||
this.name = this.constructor.name;
|
||||
}
|
||||
|
||||
this.cause = isError(cause) ? cause : undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import { CustomErrorBase } from './CustomErrorBase';
|
||||
* @public
|
||||
*/
|
||||
export class InputError extends CustomErrorBase {
|
||||
name = 'InputError';
|
||||
name = 'InputError' as const;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,7 +43,7 @@ export class InputError extends CustomErrorBase {
|
||||
* @public
|
||||
*/
|
||||
export class AuthenticationError extends CustomErrorBase {
|
||||
name = 'AuthenticationError';
|
||||
name = 'AuthenticationError' as const;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ export class AuthenticationError extends CustomErrorBase {
|
||||
* @public
|
||||
*/
|
||||
export class NotAllowedError extends CustomErrorBase {
|
||||
name = 'NotAllowedError';
|
||||
name = 'NotAllowedError' as const;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,7 +64,7 @@ export class NotAllowedError extends CustomErrorBase {
|
||||
* @public
|
||||
*/
|
||||
export class NotFoundError extends CustomErrorBase {
|
||||
name = 'NotFoundError';
|
||||
name = 'NotFoundError' as const;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ export class NotFoundError extends CustomErrorBase {
|
||||
* @public
|
||||
*/
|
||||
export class ConflictError extends CustomErrorBase {
|
||||
name = 'ConflictError';
|
||||
name = 'ConflictError' as const;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +83,7 @@ export class ConflictError extends CustomErrorBase {
|
||||
* @public
|
||||
*/
|
||||
export class NotModifiedError extends CustomErrorBase {
|
||||
name = 'NotModifiedError';
|
||||
name = 'NotModifiedError' as const;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,7 +92,7 @@ export class NotModifiedError extends CustomErrorBase {
|
||||
* @public
|
||||
*/
|
||||
export class NotImplementedError extends CustomErrorBase {
|
||||
name = 'NotImplementedError';
|
||||
name = 'NotImplementedError' as const;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user