Line data Source code
1 : 2 : #pragma once 3 : #include <exception> 4 : #include <string> 5 : 6 : namespace sipai { 7 : /** 8 : * @brief A custom exception class that inherits from std::exception. 9 : * This class is thrown when there are issues with file reader operations. 10 : */ 11 : class FileReaderException : public std::exception { 12 : public: 13 1 : explicit FileReaderException(const std::string &message) 14 1 : : message_(message) {} 15 1 : const char *what() const noexcept override { return message_.c_str(); } 16 : 17 : private: 18 : std::string message_; 19 : }; 20 : } // namespace sipai