Skip to content

Commit e7dfe88

Browse files
committed
Do not swallow too broad exceptions
1 parent 67d1dfc commit e7dfe88

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

uchecker.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,12 @@ def timeout_handler(signum, frame):
106106
signal.signal(signal.SIGALRM, old_handler)
107107
raise
108108

109-
except Exception as e:
110-
logging.debug('Subprocess error: %s', str(e))
109+
except (subprocess.SubprocessError, OSError) as e:
110+
logging.error('Subprocess error: %s', str(e))
111111
return ''
112+
except Exception as e:
113+
logging.critical('Unexpected error: %s', str(e))
114+
raise
112115

113116

114117
def _linux_distribution(*args, **kwargs):

0 commit comments

Comments
 (0)