General IRI utilities
eventexceptions.cpp
1 // Copyright (C) 2009-2010 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
2 // Author Sergi Hernandez (shernand@iri.upc.edu)
3 // All rights reserved.
4 //
5 // This file is part of iriutils
6 // iriutils is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU Lesser General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 #include "eventexceptions.h"
20 #include <string.h>
21 #include <stdio.h>
22 
23 const std::string event_exception_msg="[CEvent class] - ";
24 const std::string event_server_exception_msg="[CEventServer class] - ";
25 const std::string event_timeout_exception_msg="[Timeout] - ";
26 
27 CEventException::CEventException(const std::string& where, const std::string& error_msg,const std::string& event_id):CException(where,event_exception_msg)
28 {
29  this->error_msg+=error_msg;
30  this->error_msg+=" - ";
31  this->error_msg+=event_id;
32 }
33 
34 CEventServerException::CEventServerException(const std::string& where, const std::string& error_msg,const std::string& event_id):CException(where,event_server_exception_msg)
35 {
36  this->error_msg+=error_msg;
37  this->error_msg+=" - ";
38  this->error_msg+=event_id;
39 }
40 
41 CEventTimeoutException::CEventTimeoutException(const std::string& event_id):CException("",event_timeout_exception_msg)
42 {
43  this->error_msg+=event_id;
44 }
CEventException(const std::string &where, const std::string &error_msg, const std::string &event_id)
Constructor.
CEventTimeoutException(const std::string &event_id)
Constructor.
std::string error_msg
Exception error message.
Definition: exceptions.h:90
CEventServerException(const std::string &where, const std::string &error_msg, const std::string &event_id)
Constructor.
Generic exception.
Definition: exceptions.h:76