tool-exception.inline.h 928 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef AFUN_TOOL_EXCEPTION_INLINE_H
  2. #define AFUN_TOOL_EXCEPTION_INLINE_H
  3. #include "tool-exception.h"
  4. namespace aFuntool {
  5. aFunException::aFunException(std::string msg) : message{std::move(msg)} {
  6. }
  7. const std::string &aFunException::getMessage() const {
  8. return message;
  9. }
  10. aFuntoolException::aFuntoolException(const std::string &msg) : aFunException{msg} {
  11. }
  12. FileOpenException::FileOpenException(const FilePath &file) : aFuntoolException("File cannot open: " + file) {
  13. }
  14. RegexException::RegexException(const std::string &msg) : aFuntoolException("Regex error: " + msg) {
  15. }
  16. LogFatalError::LogFatalError(const char *msg) : aFuntoolException(msg) {
  17. }
  18. Exit::Exit(int exit_code_) : aFuntoolException("Exit by user"), exit_code{exit_code_} {
  19. }
  20. int Exit::getExitCode() const {
  21. return exit_code;
  22. }
  23. }
  24. #endif //AFUN_TOOL_EXCEPTION_INLINE_H