Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper rejection
Message
From
25/08/2017 05:40:38
 
General information
Forum:
AngularJS
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01653655
Message ID:
01653740
Views:
35
This message has been marked as a message which has helped to the initial question of the thread.
Likes (1)
>>Take your pick or make up your own - angular $http (in 1.x - not 2) regards any Http status code outside of 200-299 range as being an error ......
>>
>>>
>
>There are the errors
>
>http://www.restapitutorial.com/httpstatuscodes.html
>
>Which one can I use?

If the only consumer of the $http call will be your own browser code then you could pick any (maybe 418 or 420 :-} ) - or even define your own codes for the errors that are caught.
You could define and document a whole bunch of custom status codes specific to the application. Or pick one code and include more specific information in the response body.....


If the call may be made by other clients then it's a question of picking the best fit - if the error is in the client request then pick one of the 400 codes; if on the server then 5xx....

Good decision tree for Rest error codes here : http://racksburg.com/choosing-an-http-status-code/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform