angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

$http error callback doesn't have xhr.statusText

Open phillycoder opened this issue 13 years ago • 23 comments

There is no way to get XHR statusText in $http error callback. Currently this only returns status(number - statusCode).

It would be really helpful to get status text to display the server error message in the browser.

Like examples, 404 - Resource not found 400 - User ID already exists

phillycoder avatar Apr 08 '13 20:04 phillycoder

here's the work around to get StatusText (as pointed out that some moblie browsers strip out DATA from successfull responses: http://stackoverflow.com/a/28470163/1586498

OzBob avatar Feb 12 '15 05:02 OzBob

Not sure if it'll work for everyone, but you can use then/catch. First argument of catch contains both statusText and status(which is response code) properties

oyevtushok avatar Feb 18 '15 15:02 oyevtushok

+1 to get this fixed

stefanofornari avatar Apr 01 '15 21:04 stefanofornari