Просмотр исходного кода

Added three general purpose exception classes.

Sascha Zelzer лет назад: 13
Родитель
Сommit
947280c855
2 измененных файлов с 8 добавлено и 0 удалено
  1. 4 0
      Libs/Core/ctkException.cpp
  2. 4 0
      Libs/Core/ctkException.h

+ 4 - 0
Libs/Core/ctkException.cpp

@@ -123,3 +123,7 @@ QDebug operator<<(QDebug dbg, const ctkException& exc)
   dbg << exc.what();
   return dbg.maybeSpace();
 }
+
+CTK_IMPLEMENT_EXCEPTION(ctkRuntimeException, ctkException, "ctkRuntimeException")
+CTK_IMPLEMENT_EXCEPTION(ctkInvalidArgumentException, ctkRuntimeException, "ctkInvalidArgumentException")
+CTK_IMPLEMENT_EXCEPTION(ctkIllegalStateException, ctkRuntimeException, "ctkIllegalStateException")

+ 4 - 0
Libs/Core/ctkException.h

@@ -180,4 +180,8 @@ CTK_CORE_EXPORT QDebug operator<<(QDebug dbg, const ctkException& exc);
     return new CLS(*this);                                               \
   }
 
+CTK_DECLARE_EXCEPTION(CTK_CORE_EXPORT, ctkRuntimeException, ctkException)
+CTK_DECLARE_EXCEPTION(CTK_CORE_EXPORT, ctkInvalidArgumentException, ctkRuntimeException)
+CTK_DECLARE_EXCEPTION(CTK_CORE_EXPORT, ctkIllegalStateException, ctkRuntimeException)
+
 #endif // __ctkException_h