Unfortunately, at this point in time, there is no enumeration or constant for exact error codes.
You would be better off doing something like @Jeff, suggesting you use a library such as http-status-codes , which has all of these listed and documented.
Angular The response class allows you to check whether the request was successful using the "ok" (logical) property, otherwise you can access the status code / text from this object.
source share