diff OrthancServer/main.cpp @ 291:4d7469f72a0b

embedding of dicom dictionaries
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Dec 2012 15:15:48 +0100
parents e6a4c4329481
children b9bc31c6b639
line wrap: on
line diff
--- a/OrthancServer/main.cpp	Fri Dec 14 11:24:24 2012 +0100
+++ b/OrthancServer/main.cpp	Fri Dec 14 15:15:48 2012 +0100
@@ -58,15 +58,14 @@
   {
   }
 
-  virtual void Handle(const std::vector<uint8_t>& dicomFile,
+  virtual void Handle(const std::string& dicomFile,
                       const DicomMap& dicomSummary,
                       const Json::Value& dicomJson,
                       const std::string& remoteAet)
   {
     if (dicomFile.size() > 0)
     {
-      context_.Store(reinterpret_cast<const char*>(&dicomFile[0]), dicomFile.size(),
-                     dicomSummary, dicomJson, remoteAet);
+      context_.Store(&dicomFile[0], dicomFile.size(), dicomSummary, dicomJson, remoteAet);
     }
   }
 };
@@ -187,7 +186,7 @@
 
   google::InitGoogleLogging("Orthanc");
 
-
+  int status = 0;
   try
   {
     bool isInitialized = false;
@@ -289,10 +288,15 @@
   catch (OrthancException& e)
   {
     LOG(ERROR) << "EXCEPTION [" << e.What() << "]";
-return -1;
+    status = -1;
+  }
+  catch (...)
+  {
+    LOG(ERROR) << "NATIVE EXCEPTION";
+    status = -1;
   }
 
   OrthancFinalize();
 
-  return 0;
+  return status;
 }