zopefoundation / zope.exceptions

exceptions and implementations which are general purpose
https://zopeexceptions.readthedocs.io/
Other
0 stars 6 forks source link

Narrative docs for __traceback_supplement__ incorrect #8

Closed jamadden closed 6 years ago

jamadden commented 6 years ago

The documentation gives an example where __traceback_supplement__ is set to an instance of a class.

In reality, __traceback_supplement__ is a tuple consisting of a constructor function followed by its arguments; the constructor is called to produce the instance. If this is not done, then an exception is raised and no supplement is formatted.

By default, this leads to a nasty traceback on stderr, with no explicit information about what went wrong.

The interface API docs get this correct, so only the narrative docs need updated. The narrative doc is a doctest, but the actual rendering isn't tested, so this currently goes undetected; it would be nice if that could be fixed too.