diff sat_pubsub/backend.py @ 494:468b7cd6c344 default tip

bookmark compat: handle mapped errors: This convert error on request (e.g. missing node) to appropriate stanza error.
author Goffi <goffi@goffi.org>
date Fri, 13 Dec 2024 12:23:47 +0100
parents 33222c54d2af
children
line wrap: on
line diff
--- a/sat_pubsub/backend.py	Wed Dec 11 01:19:46 2024 +0200
+++ b/sat_pubsub/backend.py	Fri Dec 13 12:23:47 2024 +0100
@@ -1510,7 +1510,7 @@
 
     pubsubService = None
 
-    _errorMap = {
+    error_map = {
         error.NodeNotFound: ('item-not-found', None, None),
         error.NodeExists: ('conflict', None, None),
         error.Forbidden: ('forbidden', None, None),
@@ -1803,9 +1803,9 @@
         d.addErrback(log.err)
 
     def _mapErrors(self, failure):
-        e = failure.trap(*list(self._errorMap.keys()))
+        e = failure.trap(*list(self.error_map.keys()))
 
-        condition, pubsubCondition, feature = self._errorMap[e]
+        condition, pubsubCondition, feature = self.error_map[e]
         msg = failure.value.msg
 
         if pubsubCondition: