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 TrainingDataFactory 10 : * operations. 11 : */ 12 : class TrainingDataFactoryException : public std::exception { 13 : public: 14 2 : explicit TrainingDataFactoryException(const std::string &message) 15 2 : : message_(message) {} 16 2 : const char *what() const noexcept override { return message_.c_str(); } 17 : 18 : private: 19 : std::string message_; 20 : }; 21 : } // namespace sipai