tool-exception.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef AFUN_TOOL_EXCEPTION_H
  2. #define AFUN_TOOL_EXCEPTION_H
  3. #include "tool-type.h"
  4. namespace aFuntool {
  5. class aFunException : public std::exception {
  6. std::string message;
  7. public:
  8. inline explicit aFunException(std::string msg);
  9. virtual const char *what();
  10. inline const std::string &getMessage() const;
  11. };
  12. class aFuntoolException : public aFunException {
  13. public:
  14. inline explicit aFuntoolException(const std::string &msg);
  15. };
  16. class FileOpenException : public aFuntoolException {
  17. public:
  18. inline explicit FileOpenException(const FilePath &file);
  19. };
  20. class RegexException : public aFuntoolException {
  21. public:
  22. inline explicit RegexException(const std::string &msg);
  23. };
  24. class LogFatalError : public aFuntoolException {
  25. public:
  26. inline explicit LogFatalError(const char *msg);
  27. };
  28. class Exit : public aFuntoolException {
  29. int exit_code;
  30. public:
  31. inline explicit Exit(int exit_code_);
  32. inline int getExitCode() const;
  33. };
  34. }
  35. #include "tool-exception.inline.h"
  36. #endif //AFUN_TOOL_EXCEPTION_H