I'd change this line to: 

data.status_code && data.status_code >= 400

Because there are legit status codes > 200 that don't represent errors. >= 400 is also the logic the backend uses to determine error state.