[PATCH 06/10] Make exception handling more specific
Brian C. Lane
bcl at redhat.com
Thu Sep 26 13:50:39 UTC 2013
On Thu, Sep 26, 2013 at 08:59:21AM -0400, David Shea wrote:
> On 09/25/2013 05:59 PM, Brian C. Lane wrote:
> >>>- except Exception as e:
> >>>+ except YumBaseError as e:
> >>> print("ERROR: transaction error: %s" % e)
> >>> finally:
> >>> print("QUIT:")
> >This is broad on purpose. We want to tell anaconda what the error is
> >when it fails, not just die with a traceback. The caller is waiting for
> >output from anaconda-yum and handling any errors that show up.
> >
> >If anything add another except Exception with a more generic error
> >instead of transaction error.
> >
> Fair enough. I'll put the try: back where it was and add a handler
> and pylint exception for Exception. It should probably exit with a
> failure there, though, right?
Just make it do a print("ERROR: ... so that the main anaconda process
will catch it and report it. If you look at the block in yumpayload.py
you'll see what it does with the output of anaconda-yum
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20130926/701ecf42/attachment.sig>
More information about the anaconda-patches
mailing list