Skip to content

Commit

Permalink
deal with errors that aren't error responses
Browse files Browse the repository at this point in the history
  • Loading branch information
artlowel committed Jul 26, 2021
1 parent 8f43fbd commit 8ee1286
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/app/core/dspace-rest/dspace-rest.service.ts
Expand Up @@ -112,11 +112,15 @@ export class DspaceRestService {
statusText: res.statusText
})),
catchError((err) => {
return observableThrowError({
statusCode: err.status,
statusText: err.statusText,
message: (hasValue(err.error) && isNotEmpty(err.error.message)) ? err.error.message : err.message
});
if (hasValue(err.status)) {
return observableThrowError({
statusCode: err.status,
statusText: err.statusText,
message: (hasValue(err.error) && isNotEmpty(err.error.message)) ? err.error.message : err.message
});
} else {
return observableThrowError(err);
}
}));
}

Expand Down

0 comments on commit 8ee1286

Please sign in to comment.