I am making a request using vue + axios. Usually like this:
axios.get('/url').then(response => {} ).catch(error => {})
This will catch the response if the HTTP response was not 404, but if it was 404 it would be caught inside the catch.
But sometimes I want the response to be treated as an error. For example, if GET /user
response 200 OK
, but no users in the data, how do I make that response be transferred into the catch block?
Is it possible to do that with axios, or does it only return response/error based on the HTTP status code?