[Python-ideas] Arguments to exceptions
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>
> That is the problem. To write the error handler, I need the misspelled
> 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
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas