diff Plugins/Samples/StorageArea/Plugin.cpp @ 1643:87c77b9b3679

provision for error codes in plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Sep 2015 14:42:20 +0200
parents da7854deb662
children b1291df2f780
line wrap: on
line diff
--- a/Plugins/Samples/StorageArea/Plugin.cpp	Wed Sep 23 13:39:00 2015 +0200
+++ b/Plugins/Samples/StorageArea/Plugin.cpp	Wed Sep 23 14:42:20 2015 +0200
@@ -43,13 +43,13 @@
   FILE* fp = fopen(path.c_str(), "wb");
   if (!fp)
   {
-    return OrthancPluginErrorCode_Plugin;
+    return OrthancPluginErrorCode_StorageAreaPlugin;
   }
 
   bool ok = fwrite(content, size, 1, fp) == 1;
   fclose(fp);
 
-  return ok ? OrthancPluginErrorCode_Success : OrthancPluginErrorCode_Plugin;
+  return ok ? OrthancPluginErrorCode_Success : OrthancPluginErrorCode_StorageAreaPlugin;
 }
 
 
@@ -63,13 +63,13 @@
   FILE* fp = fopen(path.c_str(), "rb");
   if (!fp)
   {
-    return OrthancPluginErrorCode_Plugin;
+    return OrthancPluginErrorCode_StorageAreaPlugin;
   }
 
   if (fseek(fp, 0, SEEK_END) < 0)
   {
     fclose(fp);
-    return OrthancPluginErrorCode_Plugin;
+    return OrthancPluginErrorCode_StorageAreaPlugin;
   }
 
   *size = ftell(fp);
@@ -77,7 +77,7 @@
   if (fseek(fp, 0, SEEK_SET) < 0)
   {
     fclose(fp);
-    return OrthancPluginErrorCode_Plugin;
+    return OrthancPluginErrorCode_StorageAreaPlugin;
   }
 
   bool ok = true;
@@ -98,7 +98,7 @@
 
   fclose(fp);
 
-  return ok ? OrthancPluginErrorCode_Success : OrthancPluginErrorCode_Plugin;
+  return ok ? OrthancPluginErrorCode_Success : OrthancPluginErrorCode_StorageAreaPlugin;
 }
 
 
@@ -113,7 +113,7 @@
   }
   else
   {
-    return OrthancPluginErrorCode_Plugin;
+    return OrthancPluginErrorCode_StorageAreaPlugin;
   }
 }