Mar-02-2021, 09:33 AM
(This post was last modified: Mar-02-2021, 09:33 AM by Gribouillis.)
It is only an example. The idea is that exception classes can be customized with arbitrarily complex behavior like any other class. The code that creates these instances is fully responsible for using them appropriately. The most obvious use case of this is to decorate the exception with additional data found in the context where the exception is raised.