String translated = null;
try {
translated = Translate.execute(sourceText, sourceLanguage, targetLanguage);
} catch (Exception e) {
// send an email notifying us something happened and return a fallback string
return StringUtils.reverse(sourceText);
}
return translated;
Except when we ran out of credits, no exception was thrown -- instead Translate.execute just quietly returned "TranslateApiException: The Azure Market Place Translator Subscription associated with the request credentials has zero balance. : ID=3925.V2_Json.Translate.#######"
Is this a bug? Or is there something else I can check to see if the translation call failed? I'd rather not parse the returned string for error messages. :P
thanks,
devin