def get_error(response):
errors = {<EOL><NUM_LIT>: BadRequestError,<EOL><NUM_LIT>: UnauthorizedError,<EOL><NUM_LIT>: AccessDeniedError,<EOL><NUM_LIT>: NotFoundError,<EOL><NUM_LIT>: RateLimitExceededError,<EOL><NUM_LIT>: ServerError,<EOL><NUM_LIT>: BadGatewayError,<EOL><NUM_LIT>: ServiceUnavailableError<EOL>}<EOL>error_class = HTTPError<EOL>if response.status_code in errors:<EOL><INDENT>error_class = errors[response.status_code]<EOL><DEDENT>return error_class(response)<EOL>
Gets Error by HTTP Status Code