I load some binary data using
$http.post(url, data, { responseType: "arraybuffer" }).success(
function (data) { /* */ });
In case of an error, the server responds with an error JSON object like
{ "message" : "something went wrong!" }
Is there any way to get the error response in a different type than a success response?
$http.post(url, data, { responseType: "arraybuffer" })
.success(function (data) { /* */ })
.error(function (data) { /* how to access data.message ??? */ })
500
. So in the serverside code once you catch the error don't return a200
with an error message. For server errors it's5xx
and for client errors it's4xx
– Backpedal