REC RPC library
Main Page
Namespaces
Classes
Files
File List
File Members
srcs
openrobotino
rec_rpc
lib
rec
rpc
rec_rpc_Exception.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2011, REC Robotics Equipment Corporation GmbH, Planegg, Germany
3
All rights reserved.
4
5
Redistribution and use in source and binary forms, with or without modification,
6
are permitted provided that the following conditions are met:
7
8
- Redistributions of source code must retain the above copyright notice,
9
this list of conditions and the following disclaimer.
10
- Redistributions in binary form must reproduce the above copyright notice,
11
this list of conditions and the following disclaimer in the documentation and/or
12
other materials provided with the distribution.
13
- Neither the name of the REC Robotics Equipment Corporation GmbH nor the names of
14
its contributors may be used to endorse or promote products derived from this software
15
without specific prior written permission.
16
17
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
18
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
19
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
23
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
24
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
*/
26
27
#ifndef _REC_RPC_EXCEPTION_H_
28
#define _REC_RPC_EXCEPTION_H_
29
30
#include "
rec/rpc/defines.h
"
31
32
#include <QCoreApplication>
33
#include <QString>
34
#include <QMetaType>
35
#include <exception>
36
37
namespace
rec
38
{
39
namespace
rpc
40
{
42
enum
ErrorCode
43
{
44
NoError
= 0,
46
NoConnection
,
47
NotAnRPCServer
,
48
IncompatibleServer
,
49
UnknownFunction
,
50
ExecutionCancelled
,
51
ExecutionTimeout
,
52
WrongDataFormat
,
53
NoSuchTopic
,
54
ImproperTopicName
,
55
TopicAlreadyExists
,
56
AccessDenied
,
57
ImproperFunctionName
,
58
LocalTopicNull
,
60
HTTPNotFount
= 100,
61
HTTPBadRequest
,
62
HTTPMovedPermanently
,
64
UnknownError
,
66
User
= 200,
67
};
68
70
class
REC_RPC_EXPORT
Exception
:
public
std::exception
71
{
72
Q_DECLARE_TR_FUNCTIONS(
rec::rpc::Exception
);
73
74
public
:
80
Exception
(
ErrorCode
code =
UnknownError
,
const
QString& detail = QString::null );
82
virtual
~
Exception
()
throw
();
83
85
ErrorCode
errorCode()
const
;
87
QString getMessage()
const
;
89
QString detail()
const
;
90
96
virtual
const
char
* what()
const
throw
();
97
105
static
QString messageFromErrorCode(
ErrorCode
code );
106
107
private
:
108
ErrorCode
_code;
109
mutable
QByteArray _msg;
110
const
QString _detail;
111
};
112
}
113
}
114
115
Q_DECLARE_METATYPE(
rec::rpc::ErrorCode
);
116
117
#endif //_REC_RPC_EXCEPTION_H_
rec::rpc::NoConnection
Definition:
rec_rpc_Exception.h:46
rec::rpc::ErrorCode
ErrorCode
Pre-defined error codes.
Definition:
rec_rpc_Exception.h:42
rec::rpc::NoError
Definition:
rec_rpc_Exception.h:44
rec
Definition:
rec_rpc_Client.h:34
rec::rpc::ExecutionTimeout
Definition:
rec_rpc_Exception.h:51
rec::rpc::IncompatibleServer
Definition:
rec_rpc_Exception.h:48
rec::rpc::LocalTopicNull
Definition:
rec_rpc_Exception.h:58
rec::rpc::UnknownFunction
Definition:
rec_rpc_Exception.h:49
rec::rpc::AccessDenied
Definition:
rec_rpc_Exception.h:56
defines.h
rec::rpc::ExecutionCancelled
Definition:
rec_rpc_Exception.h:50
rec::rpc::HTTPBadRequest
Definition:
rec_rpc_Exception.h:61
rec::rpc::Exception
Exception class.
Definition:
rec_rpc_Exception.h:70
rec::rpc::NoSuchTopic
Definition:
rec_rpc_Exception.h:53
rec::rpc::HTTPNotFount
Definition:
rec_rpc_Exception.h:60
rec::rpc::ImproperFunctionName
Definition:
rec_rpc_Exception.h:57
REC_RPC_EXPORT
#define REC_RPC_EXPORT
Definition:
defines.h:49
rec::rpc::User
Definition:
rec_rpc_Exception.h:66
rec::rpc::HTTPMovedPermanently
Definition:
rec_rpc_Exception.h:62
rec::rpc::NotAnRPCServer
Definition:
rec_rpc_Exception.h:47
rec::rpc::WrongDataFormat
Definition:
rec_rpc_Exception.h:52
rec::rpc::UnknownError
Definition:
rec_rpc_Exception.h:64
rec::rpc::TopicAlreadyExists
Definition:
rec_rpc_Exception.h:55
rec::rpc::ImproperTopicName
Definition:
rec_rpc_Exception.h:54
Generated by
1.8.11