Notify RingRTC of Failed HTTP requests
This commit is contained in:
parent
b44cabe6f9
commit
a0baa3e03f
1 changed files with 9 additions and 2 deletions
|
@ -1219,8 +1219,15 @@ export class CallingClass {
|
||||||
body
|
body
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
window.log.error('handleSendHttpRequest: fetch failed with error', err);
|
if (err.code !== -1) {
|
||||||
RingRTC.httpRequestFailed(requestId, String(err));
|
// WebAPI treats certain response codes as errors, but RingRTC still needs to
|
||||||
|
// see them. It does not currently look at the response body, so we're giving
|
||||||
|
// it an empty one.
|
||||||
|
RingRTC.receivedHttpResponse(requestId, err.code, new ArrayBuffer(0));
|
||||||
|
} else {
|
||||||
|
window.log.error('handleSendHttpRequest: fetch failed with error', err);
|
||||||
|
RingRTC.httpRequestFailed(requestId, String(err));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue