async def throw(response, loads=None, encoding=None, **kwargs):
if loads is None:<EOL><INDENT>loads = data_processing.loads<EOL><DEDENT>data = await data_processing.read(response, loads=loads,<EOL>encoding=encoding)<EOL>error = get_error(data)<EOL>if error is not None:<EOL><INDENT>exception = errors[error['<STR_LIT:code>']]<EOL>raise exception(response=response, error=error, data=data, **kwargs)<EOL><DEDENT>if response.status in statuses:<EOL><INDENT>exception = statuses[response.status]<EOL>raise exception(response=response, data=data, **kwargs)<EOL><DEDENT>raise PeonyException(response=response, data=data, **kwargs)<EOL>
Get the response data if possible and raise an exception