dveselov/python-yandex-translate

How to ignore 501 response?

Opened this issue · 2 comments

cases such as '???' and ')' throw the

')' returned:

Traceback (most recent call last):
  File "C:/Users/6347463162413d3d/PycharmProjects/untitled/THIS IS WORKING.py", line 51, in <module>
    d = translate.detect(lastMsgRcvd)
  File "C:\Python36\lib\site-packages\yandex_translate\__init__.py", line 121, in detect
    raise YandexTranslateException(501)
yandex_translate.YandexTranslateException: ERR_LANG_NOT_SUPPORTED
try:
    translate.detect(...)
except:
   pass

Damn that's what I tried, but thanks for confirming.. means when I tried try/except I had errors elsewhere in my code and it didn't work.. Thanks for the reply!