GoogleCloudPlatform / stackdriver-errors-js

Client-side JavaScript exception reporting library for Cloud Error Reporting
https://cloud.google.com/error-reporting/
Apache License 2.0
362 stars 54 forks source link

Give clear results when report promise completes #59

Closed bz2 closed 5 years ago

bz2 commented 5 years ago

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 GoogleCloudPlatform/stackdriver-errors-js#32

Was tempted to just resolve(payload) but that object includes some instance level config that could accidentally be mutated, so be conservative for now. Will need to update README with usage suggestions later.