zopefoundation / zExceptions

zExceptions contains common exceptions used in Zope.
Other
0 stars 5 forks source link

raise ... from ... not supportet by exception-formatter? #14

Open jensens opened 2 years ago

jensens commented 2 years ago

BUG or UNSUPPORTED PYTHON FEATURE

What I did:

In my code used the raise from construct see also https://www.pythontutorial.net/python-oop/python-raise-from/:

try: 
   # some code
   ...
except SomeExeception as exc:
   raise MyException("my message") from exc

What I expect to happen:

an output like in core Python:

Traceback (most recent call last):
    ...
SomeExeception: some message

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
   ...
ValueError: my message

What actually happened:

I get only

Traceback (most recent call last):
   ...
ValueError: my message

What version of Python and Zope/Addons I am using:

Python 3.10 with Zope 5 and Plone 6

davisagli commented 2 years ago

Also see https://github.com/zopefoundation/zope.exceptions/issues/11