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.
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.
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.