ctkCmdLineModuleRunException.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*===================================================================
  2. BlueBerry Platform
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics.
  5. All rights reserved.
  6. This software is distributed WITHOUT ANY WARRANTY; without
  7. even the implied warranty of MERCHANTABILITY or FITNESS FOR
  8. A PARTICULAR PURPOSE.
  9. See LICENSE.txt or http://www.mitk.org for details.
  10. ===================================================================*/
  11. #include "ctkCmdLineModuleRunException.h"
  12. ctkCmdLineModuleRunException::ctkCmdLineModuleRunException(
  13. const QString& location, int errorCode, const QString &errorString)
  14. : QtConcurrent::Exception(),
  15. ctkException(QString("Running module \"%1\" failed with code %2: %3").arg(location).arg(errorCode).arg(errorString)),
  16. Location(location), ErrorCode(errorCode), ErrorString(errorString)
  17. {
  18. }
  19. ctkCmdLineModuleRunException::ctkCmdLineModuleRunException(
  20. const QString& location, int errorCode, const QString &errorString,
  21. const ctkCmdLineModuleRunException& cause)
  22. : QtConcurrent::Exception(), ctkException(location, cause),
  23. Location(location), ErrorCode(errorCode), ErrorString(errorString)
  24. {
  25. }
  26. ctkCmdLineModuleRunException::ctkCmdLineModuleRunException(const ctkCmdLineModuleRunException& o)
  27. : QtConcurrent::Exception(o), ctkException(o),
  28. Location(o.Location), ErrorCode(o.ErrorCode), ErrorString(o.ErrorString)
  29. {
  30. }
  31. ctkCmdLineModuleRunException::~ctkCmdLineModuleRunException() throw()
  32. {
  33. }
  34. QString ctkCmdLineModuleRunException::location() const throw()
  35. {
  36. return Location;
  37. }
  38. int ctkCmdLineModuleRunException::errorCode() const throw()
  39. {
  40. return ErrorCode;
  41. }
  42. QString ctkCmdLineModuleRunException::errorString() const throw()
  43. {
  44. return ErrorString;
  45. }
  46. const char* ctkCmdLineModuleRunException::name() const throw()
  47. {
  48. return "CTK CommandLineModule Run Exception";
  49. }
  50. const char* ctkCmdLineModuleRunException::className() const throw()
  51. {
  52. return "ctkCmdLineModuleRunException";
  53. }
  54. ctkCmdLineModuleRunException* ctkCmdLineModuleRunException::clone() const
  55. {
  56. return new ctkCmdLineModuleRunException(*this);
  57. }
  58. void ctkCmdLineModuleRunException::rethrow() const
  59. {
  60. throw *this;
  61. }
  62. void ctkCmdLineModuleRunException::raise() const
  63. {
  64. throw *this;
  65. }