comparison Core/Enumerations.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 210d5afd8f2b
children cb5d75143da0
comparison
equal deleted inserted replaced
2953:210d5afd8f2b 2954:d924f9bb61cc
1371 { 1371 {
1372 std::string s = "Unsupported value representation encountered: " + vr; 1372 std::string s = "Unsupported value representation encountered: " + vr;
1373 1373
1374 if (throwIfUnsupported) 1374 if (throwIfUnsupported)
1375 { 1375 {
1376 LOG(ERROR) << s; 1376 throw OrthancException(ErrorCode_ParameterOutOfRange, s);
1377 throw OrthancException(ErrorCode_ParameterOutOfRange);
1378 } 1377 }
1379 else 1378 else
1380 { 1379 {
1381 LOG(INFO) << s; 1380 LOG(INFO) << s;
1382 return ValueRepresentation_NotSupported; 1381 return ValueRepresentation_NotSupported;
1508 result = ModalityManufacturer_Generic; 1507 result = ModalityManufacturer_Generic;
1509 obsolete = true; 1508 obsolete = true;
1510 } 1509 }
1511 else 1510 else
1512 { 1511 {
1513 LOG(ERROR) << "Unknown modality manufacturer: \"" << manufacturer << "\""; 1512 throw OrthancException(ErrorCode_ParameterOutOfRange,
1514 throw OrthancException(ErrorCode_ParameterOutOfRange); 1513 "Unknown modality manufacturer: \"" + manufacturer + "\"");
1515 } 1514 }
1516 1515
1517 if (obsolete) 1516 if (obsolete)
1518 { 1517 {
1519 LOG(WARNING) << "The \"" << manufacturer << "\" manufacturer is obsolete since " 1518 LOG(WARNING) << "The \"" << manufacturer << "\" manufacturer is obsolete since "