@@ -28,73 +28,65 @@ const char* what() const noexcept override {
2828}
2929private:
3030std::string message_;
31- }; // class SerialException
31+ }; // class SerialException
3232
3333/* *
3434 * @class PortNotFoundException
3535 * @brief Exception class for port not found errors
36- *
36+ *
3737 * The PortNotFoundException class is derived from SerialException
3838 * and is used to indicate that a specified serial port could not be found.
3939 */
4040class PortNotFoundException : public SerialException {
4141public:
4242explicit PortNotFoundException (std::string message)
43- : SerialException(std::move(message)) {}
44- const char * what () const noexcept override { return message_.c_str (); }
45- private:
46- std::string message_;
43+ : SerialException(std::move(message)) {
44+ }
4745}; // class PortNotFoundException
4846
4947/* *
5048 * @class PermissionDeniedException
5149 * @brief Exception class for permission denied errors
52- *
50+ *
5351 * The PermissionDeniedException class is derived from SerialException
5452 * and is used to indicate that permission to access a specified serial port was denied.
5553 */
5654class PermissionDeniedException : public SerialException {
5755public:
5856explicit PermissionDeniedException (std::string message)
59- : SerialException(std::move(message)) {}
60- const char * what () const noexcept override { return message_.c_str (); }
61- private:
62- std::string message_;
57+ : SerialException(std::move(message)) {
58+ }
6359}; // class PermissionDeniedException
6460
6561/* *
6662 * @class TimeoutException
6763 * @brief Exception class for timeout errors
68- *
64+ *
6965 * The TimeoutException class is derived from SerialException
7066 * and is used to indicate that a serial port operation has timed out.
7167 */
7268class TimeoutException : public SerialException {
7369public:
7470explicit TimeoutException (std::string message)
75- : SerialException(std::move(message)) {}
76- const char * what () const noexcept override { return message_.c_str (); }
77- private:
78- std::string message_;
71+ : SerialException(std::move(message)) {
72+ }
7973}; // class TimeoutException
8074
8175/* *
8276 * @class IOException
8377 * @brief Exception class for I/O errors
84- *
78+ *
8579 * The IOException class is derived from SerialException
8680 * and is used to indicate that an I/O error has occurred during
8781 * serial port operations.
8882 */
8983class IOException : public SerialException {
9084public:
9185explicit IOException (std::string message)
92- : SerialException(std::move(message)) {}
93- const char * what () const noexcept override { return message_.c_str (); }
94- private:
95- std::string message_;
86+ : SerialException(std::move(message)) {
87+ }
9688}; // class IOException
9789
98- }; // namespace libserial
90+ } // namespace libserial
9991
10092#endif // INCLUDE_LIBSERIAL_SERIAL_EXCEPTION_HPP_
0 commit comments