summaryrefslogtreecommitdiff
path: root/indra/newview/lltranslate.cpp
diff options
context:
space:
mode:
authorEuclid Linden <euclid@lindenlab.com>2021-11-16 18:16:24 +0000
committerEuclid Linden <euclid@lindenlab.com>2021-11-16 18:16:24 +0000
commitb1964a47005d7bbd99258af7f4eaf4b12baeb423 (patch)
tree8e27a7cb161f6e24439a772c5bcfdd4a3ee6f83a /indra/newview/lltranslate.cpp
parente914f3e4a11ff86b3e05089c9b3a6677ec623c9c (diff)
parent17f71efce08ed4e677b497f4734d6f9f1fef56a3 (diff)
Merged in DV528-merge-6.5.1 (pull request #774)
DRTVWR-528 merge up to 6.5.1
Diffstat (limited to 'indra/newview/lltranslate.cpp')
-rw-r--r--indra/newview/lltranslate.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp
index 553a3cd086..a2c696c762 100644
--- a/indra/newview/lltranslate.cpp
+++ b/indra/newview/lltranslate.cpp
@@ -197,6 +197,11 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s
LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url, httpOpts, httpHeaders);
+ if (LLApp::isQuitting())
+ {
+ return;
+ }
+
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -207,7 +212,22 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s
const LLSD::Binary &rawBody = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_RAW].asBinary();
std::string body(rawBody.begin(), rawBody.end());
- if (this->parseResponse(parseResult, body, translation, detected_lang, err_msg))
+ bool res = false;
+
+ try
+ {
+ res = this->parseResponse(parseResult, body, translation, detected_lang, err_msg);
+ }
+ catch (std::out_of_range&)
+ {
+ LL_WARNS() << "Out of range exception on string " << body << LL_ENDL;
+ }
+ catch (...)
+ {
+ LOG_UNHANDLED_EXCEPTION( "Exception on string " + body );
+ }
+
+ if (res)
{
// Fix up the response
LLStringUtil::replaceString(translation, "&lt;", "<");