debugger_exception.h
Go to the documentation of this file.
1 /*
2  * Copyright 2006-2008 The FLWOR Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef ZORBA_DEBUGGER_EXCEPTION_H
18 #define ZORBA_DEBUGGER_EXCEPTION_H
19 
20 #include <zorba/config.h>
21 #include <exception>
22 #include <string>
23 
24 namespace zorba{
25 
26 /**
27  * Signals a problem with the execution of a socket call.
28  */
29 class ZORBA_DLL_PUBLIC DebuggerSocketException : public std::exception {
30 public:
31  /**
32  * Construct a SocketException with a explanatory message.
33  * @param message explanatory message
34  * @param inclSysMsg true if system message (from strerror(errno))
35  * should be postfixed to the user provided message
36  */
37  DebuggerSocketException(const std::string &message, bool inclSysMsg = false) throw();
38 
39  /**
40  * Provided just to guarantee that no exceptions are thrown.
41  */
42  ~DebuggerSocketException() throw();
43 
44  /**
45  * Get the exception message
46  * @return exception message
47  */
48  const char *what() const throw();
49 
50 private:
51  std::string userMessage; // Exception message
52 };
53 }//end of namespace
54 #endif
55 /* vim:set et sw=2 ts=2: */