Skip to content

Commit 61eeb47

Browse files
committed
fix: replace usage of deprecated isError function
1 parent d47be8a commit 61eeb47

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/interfaces.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import Request from './Request';
44
import Response from './Response';
55
import { LogLevel } from './logging/logging-types';
6-
import { isError } from 'util';
76
import { isNumber } from '@silvermine/toolbox';
87
import { StatusCodes } from './status-codes';
98

@@ -267,7 +266,7 @@ export interface RouteProcessorAppender<T> {
267266
export type ErrorWithStatusCode<T extends Error> = T & { statusCode?: number };
268267

269268
export function isErrorWithStatusCode<T extends Error>(o: any): o is ErrorWithStatusCode<T> {
270-
return isError(o)
269+
return o instanceof Error
271270
&& isNumber((o as any).statusCode)
272271
&& StatusCodes[(o as any).statusCode] !== undefined;
273272
}

0 commit comments

Comments
 (0)