Branch data Line data Source code
1 : : #ifndef CAN_DRIVER_EXCEPTIONS_CANCLOSEEXCEPTION_HPP
2 : : #define CAN_DRIVER_EXCEPTIONS_CANCLOSEEXCEPTION_HPP
3 : :
4 : : #include <exception>
5 : : #include <string>
6 : : #include <utility>
7 : :
8 : : namespace candriver::exceptions {
9 : :
10 : : using std::exception;
11 : : using std::string;
12 : :
13 : : /**
14 : : * @brief An exception that may be thrown when an error occurred while closing a CAN socket.
15 : : */
16 : : class CanCloseException : public exception {
17 : : public: // +++ Constructor / Destructor +++
18 : 0 : explicit CanCloseException(string message) : _message(std::move(message)) {}
19 : 0 : virtual ~CanCloseException() {}
20 : 0 : [[nodiscard]] auto what() const noexcept -> const char* override { return _message.c_str(); }
21 : :
22 : : private:
23 : : string _message;
24 : : };
25 : :
26 : : } // namespace candriver::exceptions
27 : :
28 : : #endif // CAN_DRIVER_EXCEPTIONS_CANCLOSEEXCEPTION_HPP
|