Letter replacer - suggestions?
Cameron Simpson
cs at cskk.id.au
Sat Dec 12 03:51:52 EST 2020
On 12Dec2020 01:49, Bischoop <Bischoop at vimart.net> wrote:
>On 2020-12-07, Grant Edwards <grant.b.edwards at gmail.com> wrote:
>> On 2020-12-07, MRAB <python at mrabarnett.plus.com> wrote:
>>> Avoid a 'bare' except unless you _really_ mean it, which is
>>> virtually never. Catch only those exceptions that you're going to
>>> handle.
>>
>> And sometimes "handling" is just printing some extra stuff and then
>> re-raising the original exception:
>>
>> try:
>> something():
>> except:
>> print(<whatever might be helpful for troubleshooting>)
>> raise
>
>Noted, thanks.
Also note that the exception itself is very interesting. So:
except Exception as e:
print(<whatever might be helpful for troubleshooting>, e)
raise
Cheers,
Cameron Simpson <cs at cskk.id.au>
More information about the Python-list
mailing list