Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 #include <telekyb_serial/SerialException.h>
00009 
00010 #include <ros/ros.h>
00011 
00012 namespace TELEKYB_NAMESPACE
00013 {
00014 
00015 SerialException::SerialException(const std::string& msg_, SerialExceptionCode code_,ros::console::Level level_)
00016         : msg(msg_), level(level_) , processed(false), code(code_) {
00017 
00018 }
00019 
00020 SerialException::~SerialException() throw() {
00021         if (!processed) {
00022                 process();
00023         }
00024 }
00025 
00026 void SerialException::process() {
00027 
00028         ROS_LOG_STREAM(level, ROSCONSOLE_DEFAULT_NAME, msg);
00029 
00030         if (level == ros::console::levels::Fatal) {
00031                 
00032                 ros::shutdown();
00033         }
00034 
00035         processed = true;
00036 }
00037 
00038 }