microsoft-translator-java-api icon indicating copy to clipboard operation
microsoft-translator-java-api copied to clipboard

Language detection error still returns 200 ok status

Open JackPGreen opened this issue 10 years ago • 0 comments

The following text can be translated into English from either Serbian or Bulgarian (I believe it's actually Serbian):

"Хелло ми наме ис Драгон"

Because of this, when the language is set to "autodetect", the translated String returned is:

"ArgumentOutOfRangeException: 'from' must be a valid language. {...} (including the leading ")

Despite this error, a 200 ok status is still returned and so the API returns the "ArgumentOutOfRangeException" thinking it's the valid translated String.

Further information on this error is here - http://social.msdn.microsoft.com/Forums/en-US/5c76aac1-6d28-49ac-8f96-5f66c47b35bc/translate-error-via-soap?forum=microsofttranslator - but unhelpfully it looks like there are other types of Exceptions that can be returned in this manner.

JackPGreen avatar Sep 02 '14 11:09 JackPGreen