Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef SERIALEXCEPTION_H_
00009 #define SERIALEXCEPTION_H_
00010
00011 #include <telekyb_defines/telekyb_defines.hpp>
00012
00013 #include <telekyb_defines/telekyb_enums.hpp>
00014
00015 #include <exception>
00016
00017
00018 #include <ros/console.h>
00019
00020 namespace TELEKYB_NAMESPACE
00021 {
00022
00023 TELEKYB_ENUM(SerialExceptionCode,
00024 (NO_ERROR)
00025 (UNABLE_TO_OPEN)
00026 (LOCKED)
00027 (NO_TTY)
00028 (IO_ERROR)
00029 (GENERAL_ERROR))
00030
00031
00032 class SerialException : public std::exception {
00033 protected:
00034 std::string msg;
00035 ros::console::Level level;
00036 bool processed;
00037
00038 public:
00039 SerialException(const std::string& msg_,
00040 SerialExceptionCode code_ = SerialExceptionCode::GENERAL_ERROR,
00041 ros::console::Level level_ = ros::console::levels::Error);
00042 virtual ~SerialException() throw();
00043
00044
00045 void process();
00046
00047
00048 SerialExceptionCode code;
00049 };
00050
00051 }
00052
00053 #endif