[issue42177] Improving KeyError exception

2020-10-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: Printing an exception is defined as printing the exception message, which currently is e.args[0]. We will not change that as it would break code worldwide. To print more, the class name can be used directly or as a key into a dict of replacements or replac

[issue42177] Improving KeyError exception

2020-10-27 Thread Orian Zinger
New submission from Orian Zinger : Hi all, As a Python developer, I encountered lots of blurry exception messages in the product logs such as: Failed to do something. Exception: 'some key' I believe printing the key name without explaining the exception itself is bad (explicit is better