Response error codes trigger promise rejection