diff Framework/StoneException.h @ 1071:6dd90b8d1589

Fixes related to refactorings in viewports.
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 15 Oct 2019 14:30:19 +0200
parents 5df50e0f0390
children 2d8ab34c8c91
line wrap: on
line diff
--- a/Framework/StoneException.h	Tue Oct 15 10:54:53 2019 +0200
+++ b/Framework/StoneException.h	Tue Oct 15 14:30:19 2019 +0200
@@ -43,6 +43,7 @@
   };
 
 
+
   class StoneException
   {
   protected:
@@ -63,7 +64,35 @@
 
     virtual const char* What() const
     {
-      return "TODO: EnumerationToString for StoneException";
+      switch (errorCode_)
+      {
+      case ErrorCode_Success:
+        return "Success";
+        break;
+      case ErrorCode_OrthancError:
+        return "OrthancError";
+        break;
+      case ErrorCode_ApplicationException:
+        return "ApplicationException";
+        break;
+      case ErrorCode_NotImplemented:
+        return "NotImplemented";
+        break;
+      case ErrorCode_CanOnlyAddOneLayerAtATime:
+        return "CanOnlyAddOneLayerAtATime";
+        break;
+      case ErrorCode_CommandJsonInvalidFormat:
+        return "CommandJsonInvalidFormat";
+        break;
+      case ErrorCode_WebGLContextLost:
+        return "WebGLContextLost";
+        break;
+      case ErrorCode_Last:
+        return "Last";
+        break;
+      default:
+        return "Unknown exception code!";
+      }
     }
   };
 }