1 // ----------------------------------------------------------------------------
2 //
3 // flxmlrpc Copyright (c) 2015 by W1HKJ, Dave Freese <iam_w1hkj@w1hkj.com>
4 //
5 // XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
6 //
7 // This file is part of fldigi
8 //
9 // flxmlrpc is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU Lesser General Public License as published by
11 // the Free Software Foundation; either version 3 of the License, or
12 // (at your option) any later version.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 // ----------------------------------------------------------------------------
17 
18 #ifndef _XMLRPCEXCEPTION_H_
19 #define _XMLRPCEXCEPTION_H_
20 
21 #if defined(_MSC_VER)
22 # pragma warning(disable:4786)    // identifier was truncated in debug info
23 #endif
24 
25 #ifndef MAKEDEPEND
26 # include <string>
27 #endif
28 
29 
30 namespace XmlRpc {
31 
32   //! A class representing an error.
33   //! If server methods throw this exception, a fault response is returned
34   //! to the client.
35   class XmlRpcException {
36   public:
37     //! Constructor
38     //!   @param message  A descriptive error message
39     //!   @param code     An integer error code
40     XmlRpcException(const std::string& message, int code=-1) :
_message(message)41         _message(message), _code(code) {}
42 
43     //! Return the error message.
getMessage()44     const std::string& getMessage() const { return _message; }
45 
46     //! Return the error code.
getCode()47     int getCode() const { return _code; }
48 
49   private:
50     std::string _message;
51     int _code;
52   };
53 
54 }
55 
56 #endif	// _XMLRPCEXCEPTION_H_
57