File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
modules/data/src/dataservices Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,12 @@ import { RequestData } from './interfaces';
77 * @param error the HttpErrorResponse or the error thrown by the service
88 * @param requestData the HTTP request information such as the method and the url.
99 */
10- // If extend from Error, `dse instanceof DataServiceError` returns false
11- // in some (all?) unit tests so don't bother trying.
12- export class DataServiceError {
13- message : string | null ;
14-
10+ export class DataServiceError extends Error {
1511 constructor ( public error : any , public requestData : RequestData | null ) {
16- this . message = typeof error === 'string' ? error : extractMessage ( error ) ;
12+ super (
13+ typeof error === 'string' ? error : extractMessage ( error ) ?? undefined
14+ ) ;
15+ this . name = this . constructor . name ;
1716 }
1817}
1918
You can’t perform that action at this time.
0 commit comments