I want to catch a specific exception and present a message rather than the exception raise and breaking the code.
The exception is:
I know where in the code the exception raises and that I should wrap it with try-except. I don't know how to "Import" the specific exception and then use it properly in the code
I tried to build the exception like this:
class PEFileNotSupportedException(Exception):
def __init__(self):
super(PEFileNotSupportedException, self).__init__
and then import it and use it like that:
try:
os.system(command)
except:
raise PEFileNotSupportedException("The DDL of this type are NOT supported!!!")
But it is not working.