summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--synapse/events/__init__.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index e673e96cc0..d4d1b92f7a 100644
--- a/synapse/events/__init__.py
+++ b/synapse/events/__init__.py
@@ -48,13 +48,22 @@ class _EventInternalMetadata(object):
 
 def _event_dict_property(key):
     def getter(self):
-        return self._event_dict[key]
+        try:
+            return self._event_dict[key]
+        except KeyError:
+            raise AttributeError(key)
 
     def setter(self, v):
-        self._event_dict[key] = v
+        try:
+            self._event_dict[key] = v
+        except KeyError:
+            raise AttributeError(key)
 
     def delete(self):
-        del self._event_dict[key]
+        try:
+            del self._event_dict[key]
+        except KeyError:
+            raise AttributeError(key)
 
     return property(
         getter,