comparison idavoll/backend.py @ 159:6fe78048baf9

Rework error handling, depend on Twisted Words 0.4.0. Twisted Words 0.4.0 introduced support for stanza error handling, much better than the custom error handling in Idavoll. Also, all protocol-level errors were examined and brought up to date with version 1.8 of JEP-0060. As a result of the error examination, the retrieval of default configuration options using <default/> is now supported properly.
author Ralph Meijer <ralphm@ik.nu>
date Wed, 06 Sep 2006 12:38:47 +0000
parents 5191ba7c4df8
children ef22e4150caa
comparison
equal deleted inserted replaced
158:b2149e448465 159:6fe78048baf9
8 msg = '' 8 msg = ''
9 9
10 def __str__(self): 10 def __str__(self):
11 return self.msg 11 return self.msg
12 12
13 class NotAuthorized(Error): 13 class Forbidden(Error):
14 pass 14 pass
15 15
16 class PayloadExpected(Error): 16 class ItemForbidden(Error):
17 msg = 'Payload expected' 17 pass
18 18
19 class NoPayloadAllowed(Error): 19 class ItemRequired(Error):
20 msg = 'No payload allowed' 20 pass
21 21
22 class NoInstantNodes(Error): 22 class NoInstantNodes(Error):
23 pass
24
25 class NotImplemented(Error):
26 pass 23 pass
27 24
28 class NotSubscribed(Error): 25 class NotSubscribed(Error):
29 pass 26 pass
30 27
31 class InvalidConfigurationOption(Error): 28 class InvalidConfigurationOption(Error):
32 msg = 'Invalid configuration option' 29 msg = 'Invalid configuration option'
33 30
34 class InvalidConfigurationValue(Error): 31 class InvalidConfigurationValue(Error):
35 msg = 'Bad configuration value' 32 msg = 'Bad configuration value'
33
34 class NodeNotPersistent(Error):
35 pass
36
37 class NoRootNode(Error):
38 pass
36 39
37 class IBackendService(Interface): 40 class IBackendService(Interface):
38 """ Interface to a backend service of a pubsub service. """ 41 """ Interface to a backend service of a pubsub service. """
39 42
40 def __init__(storage): 43 def __init__(storage):