def _raise_for_status(response):
message = '<STR_LIT>'<EOL>if <NUM_LIT> <= response.status < <NUM_LIT>:<EOL><INDENT>message = '<STR_LIT>' % (response.status, response.reason)<EOL><DEDENT>elif <NUM_LIT> <= response.status < <NUM_LIT>:<EOL><INDENT>message = '<STR_LIT>' % (response.status, response.reason)<EOL><DEDENT>else:<EOL><INDENT>return<EOL><DEDENT>if response.status == <NUM_LIT>:<EOL><INDENT>raise ConnectionError(message)<EOL><DEDENT>if response.headers.get("<STR_LIT>", "<STR_LIT>").startswith("<STR_LIT:application/json>"):<EOL><INDENT>data = json.loads(response.data.decode('<STR_LIT:utf-8>'))<EOL>error = data.get('<STR_LIT:error>', {})<EOL>error_trace = data.get('<STR_LIT>', None)<EOL>if "<STR_LIT>" in data:<EOL><INDENT>errors = [res["<STR_LIT>"] for res in data["<STR_LIT>"]<EOL>if res.get("<STR_LIT>")]<EOL>if errors:<EOL><INDENT>raise ProgrammingError("<STR_LIT:\n>".join(errors))<EOL><DEDENT><DEDENT>if isinstance(error, dict):<EOL><INDENT>raise ProgrammingError(error.get('<STR_LIT:message>', '<STR_LIT>'),<EOL>error_trace=error_trace)<EOL><DEDENT>raise ProgrammingError(error, error_trace=error_trace)<EOL><DEDENT>raise ProgrammingError(message)<EOL>
make sure that only crate.exceptions are raised that are defined in
    the DB-API specification