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

Не явное исключение при ошибке авторизации #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrew95qq
Copy link

@andrew95qq andrew95qq commented Jul 31, 2024

При ошибке авторизации возвращается html страница, которая не может быть распарсена в джсон, поэтому мы ловим requests.exceptions.JSONDecodeError и по началу не совсем понятно что это за ошибка и из-за чего она происходит.

А response.raise_for_status() будет выбрасывать вполне понятное исключение requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.cloudpayments.ru/test.

@andrew95qq andrew95qq changed the title add response.raise_for_status() to _send_request method Не явная ошибка при ошибке авторизации Jul 31, 2024
@andrew95qq andrew95qq changed the title Не явная ошибка при ошибке авторизации Не явное исключение при ошибке авторизации Jul 31, 2024
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 this pull request may close these issues.

1 participant