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