File: errors.py

package info (click to toggle)
synce-sync-engine 0.11.1-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 996 kB
  • ctags: 923
  • sloc: python: 8,586; xml: 949; makefile: 51; sh: 7
file content (103 lines) | stat: -rw-r--r-- 3,381 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# -*- coding: utf-8 -*-
############################################################################
# ERRORS.py
#
# Error and exception classes for sync-engine. Designed to make error
# handling a little cleaner than using bare exceptions. It also contains
# the dbus exception classes generated from dbus.exception from the original
# errors.py
#
# This module will be expanded as error handling is slowly cleaned up.
#
# Original errors.py (C) 2006  Ole André Vadla Ravnås <oleavr@gmail.com>
#
# Dr J A Gow 24/02/08
#
############################################################################

import dbus

############################################################################
# SynceError
#
# API error exception base class
#
############################################################################

class SynceError(dbus.DBusException):
	_dbus_error_name = "org.synce.SyncEngine.Error"

############################################################################
# Disconnected
#
# Device is not currently connected.
#
############################################################################

class Disconnected(SynceError):
	_dbus_error_name = SynceError._dbus_error_name + ".Disconnected"

############################################################################
# InvalidArgument
#
# One of the arguments specified is invalid.
#
############################################################################

class InvalidArgument(SynceError):
    _dbus_error_name = SynceError._dbus_error_name + ".InvalidArgument"

############################################################################
# NotAvailable
#
# The requested operation is not available.
#
############################################################################

class NotAvailable(dbus.DBusException):
    _dbus_error_name = SynceError._dbus_error_name + ".NotAvailable"

############################################################################
# NoFreeSlots
#
# No free slots on the device. Delete an existing partnership and
# try again.
#
############################################################################

class NoFreeSlots(dbus.DBusException):
    _dbus_error_name = SynceError._dbus_error_name + ".NoFreeSlots"

############################################################################
# ProtocolError
#
# An unexpected protocol error occured. This usually means that there's
# a bug in the implementation.
#
############################################################################

class ProtocolError(dbus.DBusException):
    _dbus_error_name = SynceError._dbus_error_name + ".ProtocolError"

############################################################################
# SyncRunning
#
# A sync is running, and the requested action must wait until the
# sync is complete
#
############################################################################

class SyncRunning(dbus.DBusException):
    _dbus_error_name = SynceError._dbus_error_name + ".SyncRunning"

############################################################################
# NoBoundPartnership
#
# There is no bound partnership in the device and the current action
# can not continue
#
############################################################################

class NoBoundPartnership(dbus.DBusException):
    _dbus_error_name = SynceError._dbus_error_name + ".NoBoundPartnership"