Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConnectionError object has no attribute 'status_code' #150

Closed
zonwizard opened this issue May 26, 2023 · 2 comments · Fixed by #160
Closed

ConnectionError object has no attribute 'status_code' #150

zonwizard opened this issue May 26, 2023 · 2 comments · Fixed by #160

Comments

@zonwizard
Copy link

'code': e.status_code,

        except requests.exceptions.InvalidSchema as e:
            error = {
                'success': False,
                'code': 400,
                'response': e
            }
            next_token = None
            return ApiResponse(error, next_token, headers=self.headers)
        except requests.exceptions.ConnectionError as e:
            error = {
                'success': False,
                'code': e.status_code,   <<<< ConnectionError has no status_code 
                'response': e
            }

since ConnectionError has no status_code a fixed code should be assigned.

@zonwizard
Copy link
Author

Hi @denisneuf ,
if you agree to assign 503 as the error code for a ConnectionError I can open a PR to fix this issue.
Let me know thanks.

@denisneuf
Copy link
Owner

denisneuf commented Aug 16, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants