# DBus-C++

## Desktop Communication Bus System

libdbus-c-- Documentation 0.9.0

- Files
- Data Structures
- Globals
- Main Page

error.h
Go to the documentation of this file.
1/*
2 *
3 * D-Bus++ - C++ bindings for D-Bus
4 *
5 * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com>
6 *
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24
25#ifndef __DBUSXX_ERROR_H
26#define __DBUSXX_ERROR_H
27
28#include "api.h"
29#include "util.h"
30
31#include <exception>
32
33 namespace DBus
34{
35
36 class Message;
37 class InternalError;
38
39 class DXXAPI Error : public std::exception
40{
41 public:
42
43 Error();
44
45 Error(InternalError &);
46
47 Error(const char *name, const char *message);
48
49 Error(Message &);
50
51 ~Error() throw();
52
53 const char *what() const throw();
54
55 const char *name() const;
56
57 const char *message() const;
58
59 void set(const char *name, const char *message);
60 // parameters MUST be static strings
61
62 bool is_set() const;
63
64 operator bool() const
65 {
66 return is_set();
67 }
68
69 private:
70
71 RefPtrI<InternalError> _int;
72};
73
74 struct DXXAPI ErrorFailed : public Error
75{
76 ErrorFailed(const char *message)
77 : Error("org.freedesktop.DBus.Error.Failed", message)
78 {}
79};
80
81 struct DXXAPI ErrorNoMemory : public Error
82{
83 ErrorNoMemory(const char *message)
84 : Error("org.freedesktop.DBus.Error.NoMemory", message)
85 {}
86};
87
88 struct DXXAPI ErrorServiceUnknown : public Error
89{
90 ErrorServiceUnknown(const char *message)
91 : Error("org.freedesktop.DBus.Error.ServiceUnknown", message)
92 {}
93};
94
95 struct DXXAPI ErrorNameHasNoOwner : public Error
96{
97 ErrorNameHasNoOwner(const char *message)
98 : Error("org.freedesktop.DBus.Error.NameHasNoOwner", message)
99 {}
100};
101
102 struct DXXAPI ErrorNoReply : public Error
103{
104 ErrorNoReply(const char *message)
105 : Error("org.freedesktop.DBus.Error.NoReply", message)
106 {}
107};
108
109 struct DXXAPI ErrorIOError : public Error
110{
111 ErrorIOError(const char *message)
112 : Error("org.freedesktop.DBus.Error.IOError", message)
113 {}
114};
115
116 struct DXXAPI ErrorBadAddress : public Error
117{
118 ErrorBadAddress(const char *message)
119 : Error("org.freedesktop.DBus.Error.BadAddress", message)
120 {}
121};
122
123 struct DXXAPI ErrorNotSupported : public Error
124{
125 ErrorNotSupported(const char *message)
126 : Error("org.freedesktop.DBus.Error.NotSupported", message)
127 {}
128};
129
130 struct DXXAPI ErrorLimitsExceeded : public Error
131{
132 ErrorLimitsExceeded(const char *message)
133 : Error("org.freedesktop.DBus.Error.LimitsExceeded", message)
134 {}
135};
136
137 struct DXXAPI ErrorAccessDenied : public Error
138{
139 ErrorAccessDenied(const char *message)
140 : Error("org.freedesktop.DBus.Error.AccessDenied", message)
141 {}
142};
143
144 struct DXXAPI ErrorAuthFailed : public Error
145{
146 ErrorAuthFailed(const char *message)
147 : Error("org.freedesktop.DBus.Error.AuthFailed", message)
148 {}
149};
150
151 struct DXXAPI ErrorNoServer : public Error
152{
153 ErrorNoServer(const char *message)
154 : Error("org.freedesktop.DBus.Error.NoServer", message)
155 {}
156};
157
158 struct DXXAPI ErrorTimeout : public Error
159{
160 ErrorTimeout(const char *message)
161 : Error("org.freedesktop.DBus.Error.Timeout", message)
162 {}
163};
164
165 struct DXXAPI ErrorNoNetwork : public Error
166{
167 ErrorNoNetwork(const char *message)
168 : Error("org.freedesktop.DBus.Error.NoNetwork", message)
169 {}
170};
171
172 struct DXXAPI ErrorAddressInUse : public Error
173{
174 ErrorAddressInUse(const char *message)
175 : Error("org.freedesktop.DBus.Error.AddressInUse", message)
176 {}
177};
178
179 struct DXXAPI ErrorDisconnected : public Error
180{
181 ErrorDisconnected(const char *message)
182 : Error("org.freedesktop.DBus.Error.Disconnected", message)
183 {}
184};
185
186 struct DXXAPI ErrorInvalidArgs : public Error
187{
188 ErrorInvalidArgs(const char *message)
189 : Error("org.freedesktop.DBus.Error.InvalidArgs", message)
190 {}
191};
192
193 struct DXXAPI ErrorFileNotFound : public Error
194{
195 ErrorFileNotFound(const char *message)
196 : Error("org.freedesktop.DBus.Error.FileNotFound", message)
197 {}
198};
199
200 struct DXXAPI ErrorUnknownMethod : public Error
201{
202 ErrorUnknownMethod(const char *message)
203 : Error("org.freedesktop.DBus.Error.UnknownMethod", message)
204 {}
205};
206
207 struct DXXAPI ErrorTimedOut : public Error
208{
209 ErrorTimedOut(const char *message)
210 : Error("org.freedesktop.DBus.Error.TimedOut", message)
211 {}
212};
213
214 struct DXXAPI ErrorMatchRuleNotFound : public Error
215{
216 ErrorMatchRuleNotFound(const char *message)
217 : Error("org.freedesktop.DBus.Error.MatchRuleNotFound", message)
218 {}
219};
220
221 struct DXXAPI ErrorMatchRuleInvalid : public Error
222{
223 ErrorMatchRuleInvalid(const char *message)
224 : Error("org.freedesktop.DBus.Error.MatchRuleInvalid", message)
225 {}
226};
227
228 struct DXXAPI ErrorSpawnExecFailed : public Error
229{
230 ErrorSpawnExecFailed(const char *message)
231 : Error("org.freedesktop.DBus.Error.Spawn.ExecFailed", message)
232 {}
233};
234
235 struct DXXAPI ErrorSpawnForkFailed : public Error
236{
237 ErrorSpawnForkFailed(const char *message)
238 : Error("org.freedesktop.DBus.Error.Spawn.ForkFailed", message)
239 {}
240};
241
242 struct DXXAPI ErrorSpawnChildExited : public Error
243{
244 ErrorSpawnChildExited(const char *message)
245 : Error("org.freedesktop.DBus.Error.Spawn.ChildExited", message)
246 {}
247};
248
249 struct DXXAPI ErrorSpawnChildSignaled : public Error
250{
251 ErrorSpawnChildSignaled(const char *message)
252 : Error("org.freedesktop.DBus.Error.Spawn.ChildSignaled", message)
253 {}
254};
255
256 struct DXXAPI ErrorSpawnFailed : public Error
257{
258 ErrorSpawnFailed(const char *message)
259 : Error("org.freedesktop.DBus.Error.Spawn.Failed", message)
260 {}
261};
262
263 struct DXXAPI ErrorInvalidSignature : public Error
264{
265 ErrorInvalidSignature(const char *message)
266 : Error("org.freedesktop.DBus.Error.InvalidSignature", message)
267 {}
268};
269
270 struct DXXAPI ErrorUnixProcessIdUnknown : public Error
271{
272 ErrorUnixProcessIdUnknown(const char *message)
273 : Error("org.freedesktop.DBus.Error.UnixProcessIdUnknown", message)
274 {}
275};
276
277 struct DXXAPI ErrorSELinuxSecurityContextUnknown : public Error
278{
279 ErrorSELinuxSecurityContextUnknown(const char *message)
280 : Error("org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown", message)
281 {}
282};
283
284} /* namespace DBus */
285
286#endif//__DBUSXX_ERROR_H
api.h
DXXAPI
#define DXXAPI
Definition api.h:36
DBus::Error::set
void set(const char *name, const char *message)
Definition error.cpp:80
DBus::Error::name
const char * name() const
Definition error.cpp:65
DBus::Error::what
const char * what() const
Definition error.cpp:85
DBus::Error::Error
Error()
Definition error.cpp:41
DBus::Error::message
const char * message() const
Definition error.cpp:70
DBus::Error::is_set
bool is_set() const
Definition error.cpp:75
DBus::Error::_int
RefPtrI< InternalError > _int
Definition error.h:71
DBus::Message
Definition message.h:159
DBus::RefPtrI
Definition util.h:114
DBus
Definition connection_p.h:42
DBus::ErrorAccessDenied::ErrorAccessDenied
ErrorAccessDenied(const char *message)
Definition error.h:139
DBus::ErrorAddressInUse::ErrorAddressInUse
ErrorAddressInUse(const char *message)
Definition error.h:174
DBus::ErrorAuthFailed::ErrorAuthFailed
ErrorAuthFailed(const char *message)
Definition error.h:146
DBus::ErrorBadAddress::ErrorBadAddress
ErrorBadAddress(const char *message)
Definition error.h:118
DBus::ErrorDisconnected::ErrorDisconnected
ErrorDisconnected(const char *message)
Definition error.h:181
DBus::ErrorFailed::ErrorFailed
ErrorFailed(const char *message)
Definition error.h:76
DBus::ErrorFileNotFound::ErrorFileNotFound
ErrorFileNotFound(const char *message)
Definition error.h:195
DBus::ErrorIOError::ErrorIOError
ErrorIOError(const char *message)
Definition error.h:111
DBus::ErrorInvalidArgs::ErrorInvalidArgs
ErrorInvalidArgs(const char *message)
Definition error.h:188
DBus::ErrorInvalidSignature::ErrorInvalidSignature
ErrorInvalidSignature(const char *message)
Definition error.h:265
DBus::ErrorLimitsExceeded::ErrorLimitsExceeded
ErrorLimitsExceeded(const char *message)
Definition error.h:132
DBus::ErrorMatchRuleInvalid::ErrorMatchRuleInvalid
ErrorMatchRuleInvalid(const char *message)
Definition error.h:223
DBus::ErrorMatchRuleNotFound::ErrorMatchRuleNotFound
ErrorMatchRuleNotFound(const char *message)
Definition error.h:216
DBus::ErrorNameHasNoOwner::ErrorNameHasNoOwner
ErrorNameHasNoOwner(const char *message)
Definition error.h:97
DBus::ErrorNoMemory::ErrorNoMemory
ErrorNoMemory(const char *message)
Definition error.h:83
DBus::ErrorNoNetwork::ErrorNoNetwork
ErrorNoNetwork(const char *message)
Definition error.h:167
DBus::ErrorNoReply::ErrorNoReply
ErrorNoReply(const char *message)
Definition error.h:104
DBus::ErrorNoServer::ErrorNoServer
ErrorNoServer(const char *message)
Definition error.h:153
DBus::ErrorNotSupported::ErrorNotSupported
ErrorNotSupported(const char *message)
Definition error.h:125
DBus::ErrorSELinuxSecurityContextUnknown::ErrorSELinuxSecurityContextUnknown
ErrorSELinuxSecurityContextUnknown(const char *message)
Definition error.h:279
DBus::ErrorServiceUnknown::ErrorServiceUnknown
ErrorServiceUnknown(const char *message)
Definition error.h:90
DBus::ErrorSpawnChildExited::ErrorSpawnChildExited
ErrorSpawnChildExited(const char *message)
Definition error.h:244
DBus::ErrorSpawnChildSignaled::ErrorSpawnChildSignaled
ErrorSpawnChildSignaled(const char *message)
Definition error.h:251
DBus::ErrorSpawnExecFailed::ErrorSpawnExecFailed
ErrorSpawnExecFailed(const char *message)
Definition error.h:230
DBus::ErrorSpawnFailed::ErrorSpawnFailed
ErrorSpawnFailed(const char *message)
Definition error.h:258
DBus::ErrorSpawnForkFailed::ErrorSpawnForkFailed
ErrorSpawnForkFailed(const char *message)
Definition error.h:237
DBus::ErrorTimedOut::ErrorTimedOut
ErrorTimedOut(const char *message)
Definition error.h:209
DBus::ErrorTimeout::ErrorTimeout
ErrorTimeout(const char *message)
Definition error.h:160
DBus::ErrorUnixProcessIdUnknown::ErrorUnixProcessIdUnknown
ErrorUnixProcessIdUnknown(const char *message)
Definition error.h:272
DBus::ErrorUnknownMethod::ErrorUnknownMethod
ErrorUnknownMethod(const char *message)
Definition error.h:202
DBus::InternalError
Definition internalerror.h:40
util.h