diff Core/DicomNetworking/DicomServer.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 878b59270859
children 4e43e67f8ecf
line wrap: on
line diff
--- a/Core/DicomNetworking/DicomServer.cpp	Mon Dec 03 11:49:39 2018 +0100
+++ b/Core/DicomNetworking/DicomServer.cpp	Mon Dec 03 14:35:34 2018 +0100
@@ -316,8 +316,8 @@
   {
     if (modalities_ == NULL)
     {
-      LOG(ERROR) << "No list of modalities was provided to the DICOM server";
-      throw OrthancException(ErrorCode_BadSequenceOfCalls);
+      throw OrthancException(ErrorCode_BadSequenceOfCalls,
+                             "No list of modalities was provided to the DICOM server");
     }
     
     Stop();
@@ -327,8 +327,8 @@
       (NET_ACCEPTOR, OFstatic_cast(int, port_), /*opt_acse_timeout*/ 30, &pimpl_->network_);
     if (cond.bad())
     {
-      LOG(ERROR) << "cannot create network: " << cond.text();
-      throw OrthancException(ErrorCode_DicomPortInUse);
+      throw OrthancException(ErrorCode_DicomPortInUse,
+                             "cannot create network: " + std::string(cond.text()));
     }
 
     continue_ = true;