Commit 3b53140e authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

networcache: Fix exception handling

Avoid catching interruptions and system calls during exception handling
parent 32f178e5
...@@ -30,7 +30,7 @@ try: ...@@ -30,7 +30,7 @@ try:
LIBNETWORKCACHE_ENABLED = False LIBNETWORKCACHE_ENABLED = False
else: else:
LIBNETWORKCACHE_ENABLED = True LIBNETWORKCACHE_ENABLED = True
except: except Exception:
print('There was problem while trying to import slapos.libnetworkcache:\n%s' print('There was problem while trying to import slapos.libnetworkcache:\n%s'
% traceback.format_exc()) % traceback.format_exc())
LIBNETWORKCACHE_ENABLED = False LIBNETWORKCACHE_ENABLED = False
...@@ -46,7 +46,7 @@ def fallback_call(function): ...@@ -46,7 +46,7 @@ def fallback_call(function):
""" """
try: try:
return function(self, *args, **kwd) return function(self, *args, **kwd)
except: # indeed, *any* exception is swallowed except Exception:
print('There was problem while calling method %r:\n%s' % ( print('There was problem while calling method %r:\n%s' % (
function.__name__, traceback.format_exc())) function.__name__, traceback.format_exc()))
return False return False
......
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