Handle API errors with exceptions

#16 · closed · 2 comments

View on GitHub ↗

maxkoryukov

The translator returned string instead of an exception. ``` t.translate('Hello, it is Duke', lang_from='en', lang_to='cn') >> u"ArgumentOutOfRangeException: 'to' must be a valid language\r\nParameter name: to : ID=1230.V2_Json.Translate.2B006DE5" ```

Comments

maxkoryukov

And the problem not only in langcode (Chinese - `zh`, not `cn`), but in the returned value. Now - text Should be - exception

wronglink

@maxkoryukov thx for issue. I've added a API errors handling.