Commit efcff547 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[1542] Different rcodes for expected exceptions

parent 67b1031e
......@@ -805,6 +805,10 @@ class BoB:
'token': token,
'path': self._socket_path
except isc.bind10.socket_cache.SocketError as e:
return isc.config.ccsession.create_answer(2, str(e))
except isc.bind10.socket_cache.ShareError as e:
return isc.config.ccsession.create_answer(3, str(e))
except Exception as e:
return isc.config.ccsession.create_answer(1, str(e))
......@@ -296,6 +296,13 @@ class TestCacheCommands(unittest.TestCase):
# to an error, not propagated
self.__raise_exception = Exception("Test exception")
check_code(1, self.__socket_args)
# The special "expected" exceptions
self.__raise_exception = \
isc.bind10.socket_cache.ShareError("Not shared")
check_code(3, self.__socket_args)
self.__raise_exception = \
isc.bind10.socket_cache.SocketError("Not shared", 13)
check_code(2, self.__socket_args)
def drop_socket(self, token):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment