tool-exception.h 1.1 KB

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