A
A
Anton Manevant2014-01-15 08:32:52
Python
Anton Manevant, 2014-01-15 08:32:52

How to make user-define exception behave like base class Exception?

Subject. There is a custom class inherited from Exception(BasedException). Prompt:
1. How to force this class to intercept all errors from try-except constructions? (How does Except do it)
2. How is exception logic built in python? How is the case of an error occurring in the class itself described? without the participation of the raise command?
The task is to create an error collector (implemented as a custom exception) with additional functionality in the form of recording errors that occur in the database.
Thank you very much in advance.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question