diff idavoll/backend.py @ 171:bc269696ef42

Reply with the correct error condition on subscription when not subscribed. Author: ralphm. Fixes #7.
author Ralph Meijer <ralphm@ik.nu>
date Thu, 03 Jan 2008 13:10:25 +0000
parents 96afb248df5e
children 9bfb00edd0cc
line wrap: on
line diff
--- a/idavoll/backend.py	Tue Oct 09 10:20:25 2007 +0000
+++ b/idavoll/backend.py	Thu Jan 03 13:10:25 2008 +0000
@@ -1,6 +1,6 @@
 # -*- test-case-name: idavoll.test.test_backend -*-
 #
-# Copyright (c) 2003-2007 Ralph Meijer
+# Copyright (c) 2003-2008 Ralph Meijer
 # See LICENSE for details.
 
 import uuid
@@ -24,6 +24,7 @@
     d.addCallback(lambda affiliation: (node, affiliation))
     return d
 
+
 class BackendService(service.Service, utility.EventDispatcher):
 
     implements(iidavoll.IBackendService)
@@ -360,16 +361,13 @@
     _errorMap = {
         error.NodeNotFound: ('item-not-found', None, None),
         error.NodeExists: ('conflict', None, None),
-        error.SubscriptionNotFound: ('not-authorized',
-                                     'not-subscribed',
-                                     None),
         error.Forbidden: ('forbidden', None, None),
         error.ItemForbidden: ('bad-request', 'item-forbidden', None),
         error.ItemRequired: ('bad-request', 'item-required', None),
         error.NoInstantNodes: ('not-acceptable',
                                'unsupported',
                                'instant-nodes'),
-        error.NotSubscribed: ('not-authorized', 'not-subscribed', None),
+        error.NotSubscribed: ('unexpected-request', 'not-subscribed', None),
         error.InvalidConfigurationOption: ('not-acceptable', None, None),
         error.InvalidConfigurationValue: ('not-acceptable', None, None),
         error.NodeNotPersistent: ('feature-not-implemented',