-
Notifications
You must be signed in to change notification settings - Fork 719
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
Add raise_exception option to Translator to add workaround for json.decoder.JSONDecodeError #51
Conversation
…codeError during parsing error page.
googletrans/client.py
Outdated
""" | ||
|
||
def __init__(self, service_urls=None, user_agent=DEFAULT_USER_AGENT, proxies=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain me why you removed proxy support instead of just adding an needed argument? I think you did by mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's my mistake - no purpose here
Hi, guys. Why we do not merge this to the master if it works? |
@luminousmen could you please try to fix the coverage? |
@kasnitski done, sorry - already forgot about this PR |
@ssut let's merge? what do you think? |
Why not always rise exception? It's on user to decide what to do if the function breaks in some way so those strange motions with It would be more clear if custom exception were raised with current service_url, error code and text of error page's |
This has been merged into #181. |
During translating google API can send you error page back. In my use case this was caused by russian text with emojies. I've this issue with chinese to english translation. Do not really know the underlying reason (I guess it's author's generated token -- cause I get 403 status code), but implement simple workaround for this.