comparison Core/Toolbox.cpp @ 2954:d924f9bb61cc

taking advantage of details in OrthancException
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 03 Dec 2018 14:35:34 +0100
parents 89f2c302fc37
children 4e43e67f8ecf
comparison
equal deleted inserted replaced
2953:210d5afd8f2b 2954:d924f9bb61cc
1390 } 1390 }
1391 1391
1392 if (!ok && 1392 if (!ok &&
1393 !SetGlobalLocale(NULL)) 1393 !SetGlobalLocale(NULL))
1394 { 1394 {
1395 LOG(ERROR) << "Cannot initialize global locale"; 1395 throw OrthancException(ErrorCode_InternalError,
1396 throw OrthancException(ErrorCode_InternalError); 1396 "Cannot initialize global locale");
1397 } 1397 }
1398 1398
1399 } 1399 }
1400 1400
1401 1401
1407 1407
1408 std::string Toolbox::ToUpperCaseWithAccents(const std::string& source) 1408 std::string Toolbox::ToUpperCaseWithAccents(const std::string& source)
1409 { 1409 {
1410 if (globalLocale_.get() == NULL) 1410 if (globalLocale_.get() == NULL)
1411 { 1411 {
1412 LOG(ERROR) << "No global locale was set, call Toolbox::InitializeGlobalLocale()"; 1412 throw OrthancException(ErrorCode_BadSequenceOfCalls,
1413 throw OrthancException(ErrorCode_BadSequenceOfCalls); 1413 "No global locale was set, call Toolbox::InitializeGlobalLocale()");
1414 } 1414 }
1415 1415
1416 /** 1416 /**
1417 * A few notes about locales: 1417 * A few notes about locales:
1418 * 1418 *