Error handling
- By default http-pro throws an error if response.status is not between
200and299.
note
http-pro throws a custom Error called HttpProError when statucCode is not valid. you can check if given error is HttpProError or not by using isHttpProError function.
Custom-error handling
- If you want to customize the default behaviour of error logic, you can use validateStatus property of
httpOptions. it will getstatusCodeas an arguement and it needs to returnboolean, if function returnstrueit will not throw an Error otherwise it will.