Change default error code from 500 to 503 in case message is not ready
[osm/common.git] / osm_common / msgbase.py
index a9d44d7..2b338df 100644 (file)
@@ -10,7 +10,7 @@ class MsgException(Exception):
     Base Exception class for all msgXXXX exceptions
     """
 
-    def __init__(self, message, http_code=HTTPStatus.INTERNAL_SERVER_ERROR):
+    def __init__(self, message, http_code=HTTPStatus.SERVICE_UNAVAILABLE):
         """
         General exception
         :param message:  descriptive text
@@ -35,13 +35,13 @@ class MsgBase(object):
         pass
 
     def write(self, topic, key, msg):
-        pass
+        raise MsgException("Method 'write' not implemented")
 
     def read(self, topic):
-        pass
+        raise MsgException("Method 'read' not implemented")
 
     async def aiowrite(self, topic, key, msg, loop):
-        pass
+        raise MsgException("Method 'aiowrite' not implemented")
 
     async def aioread(self, topic, loop):
-        pass
+        raise MsgException("Method 'aioread' not implemented")