Fix #2414 - Error callback receives xhr.