[Python-ideas] Arguments to exceptions
Juancarlo Añez
apalala at gmail.com
Mon Jul 3 06:29:05 EDT 2017
On Mon, Jul 3, 2017 at 4:59 AM, Ken Kundert <python-ideas at shalmirane.com>
wrote:
> That is the problem. To write the error handler, I need the misspelled
> name.
> The only way to get it is to extract it from the error message. The need to
> unpack information that was just packed suggests that the packing was done
> too
> early. That is my point.
>
1. You can pass an object with all the required information and an
appropriate __str__() method to the exception constructor.
2. If you own the exception hierarchy, you can modify the __str__()
method of the exception class.
--
Juancarlo *Añez*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170703/73ad693f/attachment.html>
More information about the Python-ideas
mailing list