# telepathy-spec - Base classes defining the interfaces of the Telepathy framework
#
# Copyright (C) 2005,2006 Collabora Limited
# Copyright (C) 2005,2006 Nokia Corporation
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

import dbus

_TELEPATHY_ERROR_IFACE = 'org.freedesktop.Telepathy.Error'

class NetworkError(dbus.DBusException):
    """
    Raised when there is an error reading from or writing to the network.
    """
    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.NetworkError'

class NotImplemented(dbus.DBusException):
    """
    Raised when the requested method, channel, etc is not available on this connection.
    """
    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.NotImplemented'

class InvalidArgument(dbus.DBusException):
    """
    Raised when one of the provided arguments is invalid.
    """
    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.InvalidArgument'

class NotAvailable(dbus.DBusException):
    """
    Raised when the requested functionality is temporarily unavailable.
    """
    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.NotAvailable'

class PermissionDenied(dbus.DBusException):
    """
    The user is not permitted to perform the requested operation.
    """
    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.PermissionDenied'

class Disconnected(dbus.DBusException):
    """
    The connection is not currently connected and cannot be used.
    """
    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.Disconnected'

class InvalidHandle(dbus.DBusException):
    """
    The contact name specified is unknown on this channel or connection.
    """
    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.InvalidHandle'

class ChannelBanned(dbus.DBusException):
    """
    You are banned from the channel.
    """
    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.Channel.Banned'

class ChannelFull(dbus.DBusException):
    """
    The channel is full.
    """
    _dbus_error_name = _TELEPATHY_ERROR_IFACE +'.Channel.Full'

class ChannelInviteOnly(dbus.DBusException):
    """
    The requested channel is invite only.
    """
    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.Channel.InviteOnly'

if __name__ == '__main__':
    def _check():
        import telepathy._generated.errors as errors
        for name in globals():
            if name not in ('_check', '__doc__', '__builtins__',
                            '__file__', '__name__', 'dbus',
                            '_TELEPATHY_ERROR_IFACE'):
                e = getattr(errors, name)
                assert e._dbus_error_name == globals()[name]._dbus_error_name, name
    _check()

@@ -910,1898 +910,291 @@
 us%0A%0A
-_TELEPATHY_ERROR_IFACE = 'org.freedesktop.Telepathy.Error'%0A%0Aclass NetworkError(dbus.DBusException):%0A    %22%22%22%0A    Raised when there is an error reading from or writing to the network.%0A    %22%22%22%0A    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.NetworkError'%0A%0Aclass NotImplemented(dbus.DBusException):%0A    %22%22%22%0A    Raised when the requested method, channel, etc is not available on this connection.%0A    %22%22%22%0A    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.NotImplemented'%0A%0Aclass InvalidArgument(dbus.DBusException):%0A    %22%22%22%0A    Raised when one of the provided arguments is invalid.%0A    %22%22%22%0A    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.InvalidArgument'%0A%0Aclass NotAvailable(dbus.DBusException):%0A    %22%22%22%0A    Raised when the requested functionality is temporarily unavailable.%0A    %22%22%22%0A    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.NotAvailable'%0A%0Aclass PermissionDenied(dbus.DBusException):%0A    %22%22%22%0A    The user is not permitted to perform the requested operation.%0A    %22%22%22%0A    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.PermissionDenied'%0A%0Aclass Disconnected(dbus.DBusException):%0A    %22%22%22%0A    The connection is not currently connected and cannot be used.%0A    %22%22%22%0A    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.Disconnected'%0A%0Aclass InvalidHandle(dbus.DBusException):%0A    %22%22%22%0A    The contact name specified is unknown on this channel or connection.%0A    %22%22%22%0A    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.InvalidHandle'%0A%0Aclass ChannelBanned(dbus.DBusException):%0A    %22%22%22%0A    You are banned from the channel.%0A    %22%22%22%0A    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.
+from telepathy._generated.errors import %5C%0A        NetworkError, %5C%0A        NotImplemented, %5C%0A        InvalidArgument, %5C%0A        NotAvailable, %5C%0A        PermissionDenied, %5C%0A        Disconnected, %5C%0A        InvalidHandle, %5C%0A        
 Channel
-.
 Banned
-'%0A%0Aclass ChannelFull(dbus.DBusException):%0A    %22%22%22%0A    The channel is full.%0A    %22%22%22%0A    _dbus_error_name = _TELEPATHY_ERROR_IFACE +'.
+, %5C%0A        
 Channel
-.
 Full
-'%0A%0Aclass ChannelInviteOnly(dbus.DBusException):%0A    %22%22%22%0A    The requested channel is invite only.%0A    %22%22%22%0A    _dbus_error_name = _TELEPATHY_ERROR_IFACE + '.
+, %5C%0A        
 Channel
-.
 Invi
@@ -1203,455 +1203,5 @@
 Only
-'%0A%0Aif __name__ == '__main__':%0A    def _check():%0A        import telepathy._generated.errors as errors%0A        for name in globals():%0A            if name not in ('_check', '__doc__', '__builtins__',%0A                            '__file__', '__name__', 'dbus',%0A                            '_TELEPATHY_ERROR_IFACE'):%0A                e = getattr(errors, name)%0A                assert e._dbus_error_name == globals()%5Bname%5D._dbus_error_name, name%0A    _check()
 %0A

Use error classes from _generated