Skip to content

Commit add8d36

Browse files
andywerabuiles
authored andcommitted
Set name in custom errors (#403)
1 parent 3f41518 commit add8d36

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/errors.ts

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export class NotFoundError extends NetworkError {
3131
super(message, response);
3232
this.__proto__ = trueProto;
3333
this.constructor = NotFoundError;
34+
this.name = "NotFoundError";
3435
}
3536
}
3637

@@ -40,6 +41,7 @@ export class BadRequestError extends NetworkError {
4041
super(message, response);
4142
this.__proto__ = trueProto;
4243
this.constructor = BadRequestError;
44+
this.name = "BadRequestError";
4345
}
4446
}
4547

@@ -49,6 +51,7 @@ export class BadResponseError extends NetworkError {
4951
super(message, response);
5052
this.__proto__ = trueProto;
5153
this.constructor = BadResponseError;
54+
this.name = "BadResponseError";
5255
}
5356
}
5457

@@ -60,5 +63,6 @@ export class InvalidSep10ChallengeError extends Error {
6063
super(message);
6164
this.__proto__ = trueProto;
6265
this.constructor = InvalidSep10ChallengeError;
66+
this.name = "InvalidSep10ChallengeError";
6367
}
6468
}

0 commit comments

Comments
 (0)