I have the following error message:
type object 'SomeClass' has no attribute 'some_class_field'
The exception is of type 'AtrributeError'.
Is there any way to change the error message to:
Provider class 'SomeClass' has no field 'some_class_field'
I guess those parameters are saved in the python exception class and I think there could be a solution of the following type:
try:
# some code
except AtrributeError as ae:
print("Provider class '{0}' has no field '{1}'").format(ae.type_object, ae.attribute))
exit(1)
ae.args[0]and extract the parts you need. Then print them out (using.formator whatever else you need).