Skip to content

Commit b4a85d0

Browse files
committed
derive from Error
1 parent 7f1b6f6 commit b4a85d0

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎src/ErrorResponse.js‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,23 @@
22
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
33

44
import Log from './Log';
5-
import UrlUtility from './UrlUtility';
65

7-
export default class ErrorResponse {
6+
export default class ErrorResponse extends Error {
87
constructor({error, error_description, error_uri, state}={}
98
) {
109
if (!error){
1110
Log.error("No error passed to ErrorResponse");
1211
throw new Error("error");
1312
}
1413

15-
this.message = error_description || error;
14+
super(error_description || error);
15+
1616
this.name = "ErrorResponse";
17-
this.stack = (new Error()).stack;
1817

1918
this.error = error;
2019
this.error_description = error_description;
2120
this.error_uri = error_uri;
2221

2322
this.state = state;
2423
}
25-
}
24+
}

0 commit comments

Comments
 (0)