fix(common): expose request url in network error (#27143)
closes #27029 PR Close #27143
This commit is contained in:
@ -232,10 +232,12 @@ export class HttpXhrBackend implements HttpBackend {
|
||||
// Connection timeout, DNS error, offline, etc. These are actual errors, and are
|
||||
// transmitted on the error channel.
|
||||
const onError = (error: ErrorEvent) => {
|
||||
const {url} = partialFromXhr();
|
||||
const res = new HttpErrorResponse({
|
||||
error,
|
||||
status: xhr.status || 0,
|
||||
statusText: xhr.statusText || 'Unknown Error',
|
||||
url: url || undefined,
|
||||
});
|
||||
observer.error(res);
|
||||
};
|
||||
|
Reference in New Issue
Block a user