comparison 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
comparison
equal deleted inserted replaced
1062:2d6237221ff1 1071:6dd90b8d1589
41 ErrorCode_WebGLContextLost, 41 ErrorCode_WebGLContextLost,
42 ErrorCode_Last 42 ErrorCode_Last
43 }; 43 };
44 44
45 45
46
46 class StoneException 47 class StoneException
47 { 48 {
48 protected: 49 protected:
49 OrthancStone::ErrorCode errorCode_; 50 OrthancStone::ErrorCode errorCode_;
50 51
61 return errorCode_; 62 return errorCode_;
62 } 63 }
63 64
64 virtual const char* What() const 65 virtual const char* What() const
65 { 66 {
66 return "TODO: EnumerationToString for StoneException"; 67 switch (errorCode_)
68 {
69 case ErrorCode_Success:
70 return "Success";
71 break;
72 case ErrorCode_OrthancError:
73 return "OrthancError";
74 break;
75 case ErrorCode_ApplicationException:
76 return "ApplicationException";
77 break;
78 case ErrorCode_NotImplemented:
79 return "NotImplemented";
80 break;
81 case ErrorCode_CanOnlyAddOneLayerAtATime:
82 return "CanOnlyAddOneLayerAtATime";
83 break;
84 case ErrorCode_CommandJsonInvalidFormat:
85 return "CommandJsonInvalidFormat";
86 break;
87 case ErrorCode_WebGLContextLost:
88 return "WebGLContextLost";
89 break;
90 case ErrorCode_Last:
91 return "Last";
92 break;
93 default:
94 return "Unknown exception code!";
95 }
67 } 96 }
68 }; 97 };
69 } 98 }
70 99
71 // See https://isocpp.org/wiki/faq/misc-technical-issues#macros-with-multi-stmts 100 // See https://isocpp.org/wiki/faq/misc-technical-issues#macros-with-multi-stmts