aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2018-08-31 12:50:24 +0100
committerBryn M. Reeves <bmr@redhat.com>2018-08-31 12:50:24 +0100
commit2e07f7c4778145d4366476ecc4383d491458b541 (patch)
tree3f4f9c9889bcfa18875290d089a02fcab255054d
parentd5b1d349b868e66a4001c23dae7afa05daaca907 (diff)
downloadsos-2e07f7c4778145d4366476ecc4383d491458b541.tar.gz
[sosreport] properly raise exceptions when --debug is given
OSError and IOError exceptions were not raised to the terminal when --debug is in effect since they were silently caught in the generic exception handler. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/sosreport.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py
index 00c3e811..80633966 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -995,7 +995,8 @@ class SoSReport(object):
print(" %s while setting up archive" % e.strerror)
print("")
else:
- raise e
+ print("Error setting up archive: %s" % e)
+ raise
except Exception as e:
self.ui_log.error("")
self.ui_log.error(" Unexpected exception setting up archive:")
@@ -1467,6 +1468,8 @@ class SoSReport(object):
return self.final_work()
except (OSError):
+ if self.opts.debug:
+ raise
self._cleanup()
except (KeyboardInterrupt):
self.ui_log.error("\nExiting on user cancel")