`onComplete` does not handle the case when the `xhr` has aborted (`req.status === 0`). This can be handled simply by ensuring the `resp` object exists.