[Yum-devel] [PATCH] add a top-level OSError handler. BZ 928839

Zdenek Pavlas zpavlas at redhat.com
Fri Mar 29 11:15:23 UTC 2013


Prevent abrt reports in obvious cases as this, or when destdir
or it's parent is readonly.  I'm not 100% sure we want to do this,
as when a real bug is hit, a traceback is much more useful than
just the error message.
---
 yumdownloader.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/yumdownloader.py b/yumdownloader.py
index 00abeef..4c5eefb 100755
--- a/yumdownloader.py
+++ b/yumdownloader.py
@@ -71,7 +71,11 @@ class YumDownloader(YumUtilBase):
                           
         # Add util commandline options to the yum-cli ones
         self.optparser = self.getOptionParser() 
-        self.main()
+        try:
+            self.main()
+        except (OSError, IOError), e:
+            self.logger.error(exception2msg(e))
+            sys.exit(1)
 
     def main(self):
         # Add command line option specific to yumdownloader
-- 
1.7.11.7



More information about the Yum-devel mailing list