Check if a response is in the expected status, otherwise throw an error
The expected status
Optional
A custom error compatible with UnexpectedStatusCodeError
The given response object
UnexpectedStatusCodeError if the status is different from the one expected
Check if a response is in the expected status, otherwise throw an error