I have a Flask app. I made a custom exception in one of my libraries related to a very specific error that I would like to notify the user about.
What I would like to happen is whenever this exception is thrown have Flask go to a default page for this exception with a short explanation of what the user needs to do.
I have
class SpecificException(Exceptions):
pass
and then
def __verify_compatible_version(self):
if self.version != VERSION:
raise SpecificException ("detected incompatible version")
I am not certain how to do that. The docs seem to make clear it is possible but I don't see any good examples nor advice for how to do it. How can I display a custom page to handle my custom exception?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…