This should be fairly easy to do, now or in a future commit - every response JSON object from the Login API includes an `error` attribute that is set to `null` when there are no errors looking like:

```javascript
if (res.error) {
  // Error logic
  return;
}
```