1 # -*- coding: utf-8 -*-
3 """Exception classes, generated from the Telepathy spec
5 Copyright © 2005-2009 Collabora Limited
6 Copyright © 2005-2009 Nokia Corporation
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 from dbus import DBusException
40 "AuthenticationFailed",
41 "EncryptionNotAvailable",
47 "CertFingerprintMismatch",
48 "CertHostnameMismatch",
65 "ResourceUnavailable",
69 class NetworkError(DBusException):
71 Raised when there is an error reading from or writing to the network.
74 _dbus_error_name = 'org.freedesktop.Telepathy.Error.NetworkError'
76 class NotImplemented(DBusException):
78 Raised when the requested method, channel, etc is not available on this connection.
81 _dbus_error_name = 'org.freedesktop.Telepathy.Error.NotImplemented'
83 class InvalidArgument(DBusException):
85 Raised when one of the provided arguments is invalid.
88 _dbus_error_name = 'org.freedesktop.Telepathy.Error.InvalidArgument'
90 class NotAvailable(DBusException):
92 Raised when the requested functionality is temporarily unavailable.
95 _dbus_error_name = 'org.freedesktop.Telepathy.Error.NotAvailable'
97 class PermissionDenied(DBusException):
99 The user is not permitted to perform the requested operation.
102 _dbus_error_name = 'org.freedesktop.Telepathy.Error.PermissionDenied'
104 class Disconnected(DBusException):
106 The connection is not currently connected and cannot be used.
107 This error may also be raised when operations are performed on a
110 has signalled status Disconnected for reason None.
113 The second usage corresponds to None in the
114 Connection_Status_Reason enum; if a better reason
115 is available, the corresponding error should be used instead.
119 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Disconnected'
121 class InvalidHandle(DBusException):
123 The handle specified is unknown on this channel or connection.
126 _dbus_error_name = 'org.freedesktop.Telepathy.Error.InvalidHandle'
128 class ChannelBanned(DBusException):
130 You are banned from the channel.
133 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Channel.Banned'
135 class ChannelFull(DBusException):
140 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Channel.Full'
142 class ChannelInviteOnly(DBusException):
144 The requested channel is invite-only.
147 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Channel.InviteOnly'
149 class NotYours(DBusException):
151 The requested channel or other resource already exists, and another
152 user interface in this session is responsible for it.
154 User interfaces SHOULD handle this error unobtrusively, since it
155 indicates that some other user interface is already processing the
159 _dbus_error_name = 'org.freedesktop.Telepathy.Error.NotYours'
161 class Cancelled(DBusException):
163 Raised by an ongoing request if it is cancelled by user request before
164 it has completed, or when operations are performed on an object which
165 the user has asked to close (for instance, a Connection where the user
166 has called Disconnect, or a Channel where the user has called Close).
169 The second form can be used to correspond to the Requested member in
170 the Connection_Status_Reason enum, or to
171 to represent the situation where disconnecting a Connection,
172 closing a Channel, etc. has been requested by the user but this
173 request has not yet been acted on, for instance because the
174 service will only act on the request when it has finished processing
179 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Cancelled'
181 class AuthenticationFailed(DBusException):
183 Raised when authentication with a service was unsuccessful.
185 This corresponds to Authentication_Failed in the
186 Connection_Status_Reason enum.
190 _dbus_error_name = 'org.freedesktop.Telepathy.Error.AuthenticationFailed'
192 class EncryptionNotAvailable(DBusException):
194 Raised if a user request insisted that encryption should be used,
195 but encryption was not actually available.
198 This corresponds to part of Encryption_Error in the
199 Connection_Status_Reason enum. It's been separated
200 into a distinct error here because the two concepts that were part
201 of EncryptionError seem to be things that could reasonably appear
202 differently in the UI.
206 _dbus_error_name = 'org.freedesktop.Telepathy.Error.EncryptionNotAvailable'
208 class EncryptionError(DBusException):
210 Raised if encryption appears to be available, but could not actually be
211 used (for instance if SSL/TLS negotiation fails).
213 This corresponds to part of Encryption_Error in the
214 Connection_Status_Reason enum.
218 _dbus_error_name = 'org.freedesktop.Telepathy.Error.EncryptionError'
220 class CertNotProvided(DBusException):
222 Raised if the server did not provide a SSL/TLS certificate. This error
223 MUST NOT be used to represent the absence of a client certificate
224 provided by the Telepathy connection manager.
226 This corresponds to Cert_Not_Provided in the
227 Connection_Status_Reason enum. That error
228 explicitly applied only to server SSL certificates, so this one
229 is similarly limited; having the CM present a client certificate
230 is a possible future feature, but it should have its own error
235 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Cert.NotProvided'
237 class CertUntrusted(DBusException):
239 Raised if the server provided a SSL/TLS certificate signed by an
240 untrusted certifying authority. This error SHOULD NOT be used to
241 represent a self-signed certificate: see the Self Signed error for that.
243 This corresponds to Cert_Untrusted in the
244 Connection_Status_Reason enum, with a clarification
249 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Cert.Untrusted'
251 class CertExpired(DBusException):
253 Raised if the server provided an expired SSL/TLS certificate.
255 This corresponds to Cert_Expired in the
256 Connection_Status_Reason enum.
260 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Cert.Expired'
262 class CertNotActivated(DBusException):
264 Raised if the server provided an SSL/TLS certificate that will become
265 valid at some point in the future.
267 This corresponds to Cert_Not_Activated in the
268 Connection_Status_Reason enum.
272 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Cert.NotActivated'
274 class CertFingerprintMismatch(DBusException):
276 Raised if the server provided an SSL/TLS certificate that did not have
277 the expected fingerprint.
279 This corresponds to Cert_Fingerprint_Mismatch in the
280 Connection_Status_Reason enum.
284 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Cert.FingerprintMismatch'
286 class CertHostnameMismatch(DBusException):
288 Raised if the server provided an SSL/TLS certificate that did not match
291 This corresponds to Cert_Hostname_Mismatch in the
292 Connection_Status_Reason enum.
296 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Cert.HostnameMismatch'
298 class CertSelfSigned(DBusException):
300 Raised if the server provided an SSL/TLS certificate that is self-signed
303 This corresponds to Cert_Hostname_Mismatch in the
304 Connection_Status_Reason enum.
308 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Cert.SelfSigned'
310 class CertInvalid(DBusException):
312 Raised if the server provided an SSL/TLS certificate that is
313 unacceptable in some way that does not have a more specific error.
315 This corresponds to Cert_Other_Error in the
316 Connection_Status_Reason enum.
320 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Cert.Invalid'
322 class NotCapable(DBusException):
324 Raised when requested functionality is unavailable due to contact
325 not having required capabilities.
328 _dbus_error_name = 'org.freedesktop.Telepathy.Error.NotCapable'
330 class Offline(DBusException):
332 Raised when requested functionality is unavailable because a contact is
336 This corresponds to Offline in the
337 Channel_Group_Change_Reason enum.
341 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Offline'
343 class ChannelKicked(DBusException):
345 Used to represent a user being ejected from a channel by another user,
346 for instance being kicked from a chatroom.
349 This corresponds to Kicked in the
350 Channel_Group_Change_Reason enum.
354 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Channel.Kicked'
356 class Busy(DBusException):
358 Used to represent a user being removed from a channel because of a
359 "busy" indication. This error SHOULD NOT be used to represent a server
360 or other infrastructure being too busy to process a request - for that,
364 This corresponds to Busy in the
365 Channel_Group_Change_Reason enum.
369 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Busy'
371 class NoAnswer(DBusException):
373 Used to represent a user being removed from a channel because they did
374 not respond, e.g. to a StreamedMedia call.
377 This corresponds to No_Answer in the
378 Channel_Group_Change_Reason enum.
382 _dbus_error_name = 'org.freedesktop.Telepathy.Error.NoAnswer'
384 class DoesNotExist(DBusException):
386 Raised when the requested user does not, in fact, exist.
389 This corresponds to Invalid_Contact in the
390 Channel_Group_Change_Reason enum, but can also be
391 used to represent other things not existing (like chatrooms, perhaps).
395 _dbus_error_name = 'org.freedesktop.Telepathy.Error.DoesNotExist'
397 class Terminated(DBusException):
399 Raised when a channel is terminated for an unspecified reason. In
400 particular, this error SHOULD be used whenever normal termination of
401 a 1-1 StreamedMedia call by the remote user is represented as a D-Bus
405 This corresponds to None in the
406 Channel_Group_Change_Reason enum.
410 _dbus_error_name = 'org.freedesktop.Telepathy.Error.Terminated'
412 class ConnectionRefused(DBusException):
414 Raised when a connection is refused.
417 _dbus_error_name = 'org.freedesktop.Telepathy.Error.ConnectionRefused'
419 class ConnectionFailed(DBusException):
421 Raised when a connection can't be established.
424 _dbus_error_name = 'org.freedesktop.Telepathy.Error.ConnectionFailed'
426 class ConnectionLost(DBusException):
428 Raised when a connection is broken.
431 _dbus_error_name = 'org.freedesktop.Telepathy.Error.ConnectionLost'
433 class AlreadyConnected(DBusException):
435 Raised when the user attempts to connect to an account but they are
436 already connected (perhaps from another client or computer), and the
437 protocol or account settings do not allow this.
440 XMPP can have this behaviour if the user chooses the same resource
441 in both clients (it is server-dependent whether the result is
442 AlreadyConnected on the new connection, ConnectionReplaced on the
443 old connection, or two successful connections).
447 _dbus_error_name = 'org.freedesktop.Telepathy.Error.AlreadyConnected'
449 class ConnectionReplaced(DBusException):
451 Raised by an existing connection to an account if it is replaced by
452 a new connection (perhaps from another client or computer).
455 In MSNP, when connecting twice with the same Passport, the new
456 connection "wins" and the old one is automatically disconnected.
457 XMPP can also have this behaviour if the user chooses the same
458 resource in two clients (it is server-dependent whether the result is
459 AlreadyConnected on the new connection, ConnectionReplaced on the
460 old connection, or two successful connections).
464 _dbus_error_name = 'org.freedesktop.Telepathy.Error.ConnectionReplaced'
466 class RegistrationExists(DBusException):
468 Raised during in-band registration if the server indicates that the
469 requested account already exists.
472 _dbus_error_name = 'org.freedesktop.Telepathy.Error.RegistrationExists'
474 class ServiceBusy(DBusException):
476 Raised if a server or some other piece of infrastructure cannot process
477 the request, e.g. due to resource limitations. Clients MAY try again
481 This is not the same error as Busy, which indicates that a
486 _dbus_error_name = 'org.freedesktop.Telepathy.Error.ServiceBusy'
488 class ResourceUnavailable(DBusException):
490 Raised if a request cannot be satisfied because a process local to the
491 user has insufficient resources. Clients MAY try again
495 For instance, the ChannelDispatcher
496 might raise this error for some or all channel requests if it has
497 detected that there is not enough free memory.
501 _dbus_error_name = 'org.freedesktop.Telepathy.Error.ResourceUnavailable'