ctkPluginException.cpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 "ctkPluginException.h"
  16. #include <QDebug>
  17. //----------------------------------------------------------------------------
  18. ctkPluginException::ctkPluginException(const QString& msg, const Type& type)
  19. : ctkRuntimeException(msg),
  20. type(type)
  21. {
  22. }
  23. //----------------------------------------------------------------------------
  24. ctkPluginException::ctkPluginException(const QString& msg, const Type& type, const ctkException& cause)
  25. : ctkRuntimeException(msg, cause),
  26. type(type)
  27. {
  28. }
  29. //----------------------------------------------------------------------------
  30. ctkPluginException::ctkPluginException(const QString& msg, const ctkException& cause)
  31. : ctkRuntimeException(msg, cause),
  32. type(UNSPECIFIED)
  33. {
  34. }
  35. //----------------------------------------------------------------------------
  36. ctkPluginException::ctkPluginException(const ctkPluginException& o)
  37. : ctkRuntimeException(o), type(o.type)
  38. {
  39. }
  40. //----------------------------------------------------------------------------
  41. ctkPluginException& ctkPluginException::operator=(const ctkPluginException& o)
  42. {
  43. ctkRuntimeException::operator=(o);
  44. type = o.type;
  45. return *this;
  46. }
  47. //----------------------------------------------------------------------------
  48. ctkPluginException::~ctkPluginException() throw()
  49. {
  50. }
  51. //----------------------------------------------------------------------------
  52. const char* ctkPluginException::name() const throw()
  53. {
  54. return "ctkPluginException";
  55. }
  56. //----------------------------------------------------------------------------
  57. ctkPluginException* ctkPluginException::clone() const
  58. {
  59. return new ctkPluginException(*this);
  60. }
  61. //----------------------------------------------------------------------------
  62. void ctkPluginException::rethrow() const
  63. {
  64. throw *this;
  65. }
  66. //----------------------------------------------------------------------------
  67. ctkPluginException::Type ctkPluginException::getType() const
  68. {
  69. return type;
  70. }