ctkApplicationException.cpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #include "ctkApplicationException.h"
  16. const int ctkApplicationException::APPLICATION_LOCKED = 0x01;
  17. const int ctkApplicationException::APPLICATION_NOT_LAUNCHABLE = 0x02;
  18. const int ctkApplicationException::APPLICATION_INTERNAL_ERROR = 0x03;
  19. const int ctkApplicationException::APPLICATION_SCHEDULING_FAILED = 0x04;
  20. const int ctkApplicationException::APPLICATION_DUPLICATE_SCHEDULE_ID = 0x05;
  21. const int ctkApplicationException::APPLICATION_EXITVALUE_NOT_AVAILABLE = 0x06;
  22. const int ctkApplicationException::APPLICATION_INVALID_STARTUP_ARGUMENT = 0x07;
  23. //----------------------------------------------------------------------------
  24. ctkApplicationException::ctkApplicationException(int errorCode)
  25. : ctkException("")
  26. , errorCode(errorCode)
  27. {
  28. }
  29. //----------------------------------------------------------------------------
  30. ctkApplicationException::ctkApplicationException(int errorCode, const ctkException& cause)
  31. : ctkException("", cause)
  32. , errorCode(errorCode)
  33. {
  34. }
  35. //----------------------------------------------------------------------------
  36. ctkApplicationException::ctkApplicationException(int errorCode, const QString& message)
  37. : ctkException(message)
  38. , errorCode(errorCode)
  39. {
  40. }
  41. //----------------------------------------------------------------------------
  42. ctkApplicationException::ctkApplicationException(int errorCode, const QString& message, const ctkException& cause)
  43. : ctkException(message, cause)
  44. , errorCode(errorCode)
  45. {
  46. }
  47. //----------------------------------------------------------------------------
  48. ctkApplicationException::~ctkApplicationException() throw()
  49. {
  50. }
  51. //----------------------------------------------------------------------------
  52. const char* ctkApplicationException::name() const throw()
  53. {
  54. return "Application Exception";
  55. }
  56. //----------------------------------------------------------------------------
  57. ctkApplicationException* ctkApplicationException::clone() const
  58. {
  59. return new ctkApplicationException(*this);
  60. }
  61. //----------------------------------------------------------------------------
  62. void ctkApplicationException::rethrow() const
  63. {
  64. throw *this;
  65. }
  66. //----------------------------------------------------------------------------
  67. int ctkApplicationException::GetErrorCode() const
  68. {
  69. return errorCode;
  70. }