Skip to content

Commit 93045d9

Browse files
committed
Ensure error has a standard interface
1 parent 31466c6 commit 93045d9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/utils/ApiError.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ import type { GenericObject } from '../types';
66
*/
77
export class ApiError extends Error {
88
status: number;
9-
statusText: string;
109
detail?: GenericObject | string;
1110
url?: string;
1211

13-
constructor(statusText: string, status: number, detail?: GenericObject | string, url?: string) {
14-
super(statusText);
12+
constructor(message: string, status: number, detail?: GenericObject | string, url?: string) {
13+
super(message);
1514
this.name = 'ApiError';
1615
this.status = status;
17-
this.statusText = statusText;
1816
this.detail = detail;
1917
this.url = url;
2018

0 commit comments

Comments
 (0)