extend rejection reason w/ json error on request error

This commit is contained in:
Leo Horie 2016-06-24 21:40:11 -04:00
parent 6e3ce0aeb5
commit 36e6894859
2 changed files with 18 additions and 1 deletions

View file

@ -51,7 +51,11 @@ module.exports = function($window) {
stream(response)
}
else stream.error(new Error(xhr.responseText))
else {
var error = new Error(xhr.responseText)
for (var key in response) error[key] = response[key]
stream.error(error)
}
}
catch (e) {
stream.error(e)