You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
report(e, callback), where callback happens on both success or failure (passed XHR error on transaction failure).
In the event that the Stackdriver XHR succeeds with a non-200, e.g. 403 due to API key origin restriction, callback is invoked without parameters, so it looks like a success to the client. This is because XMLHttpRequest.onerror is not dependent on the HTTP status code: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequestEventTarget/onerror
Possibly this method could be changed to accept two callbacks, or else use a Promise. The error path should trigger if the HTTP response status is not a 200.
The text was updated successfully, but these errors were encountered:
If the XMLHttpRequest fails or a non-2XX code results the promise
will be rejected with an Error. Otherwise it will resolve with the
message reported included.
FixesGoogleCloudPlatform#32
If the XMLHttpRequest fails or a non-2XX code results the promise
will be rejected with an Error. Otherwise it will resolve with the
message reported included.
FixesGoogleCloudPlatform#32
If the XMLHttpRequest fails or a non-2XX code results the promise
will be rejected with an Error. Otherwise it will resolve with the
message reported included.
Fixes#32
Current API signature:
report(e, callback)
, where callback happens on both success or failure (passed XHR error on transaction failure).In the event that the Stackdriver XHR succeeds with a non-200, e.g. 403 due to API key origin restriction, callback is invoked without parameters, so it looks like a success to the client. This is because
XMLHttpRequest.onerror
is not dependent on the HTTP status code: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequestEventTarget/onerrorRelevant code:
stackdriver-errors-js/stackdriver-errors.js
Line 146 in f549a50
Possibly this method could be changed to accept two callbacks, or else use a Promise. The error path should trigger if the HTTP response status is not a 200.
The text was updated successfully, but these errors were encountered: