So I have this thing I don’t know if I can do on python. I want to handle access to undefined variables. Example:
class example():
def __init__():
self.variableA = 'jaa'
def set_b(self):
self.variableB = 'nope'
Here if I instantiate a object X of example and try to access variableB without calling x.set_b() I will get an Class has no attribute
error. Is there any way to dig into this exception? I would like to return and error with a custom message.