I am getting an exception which am transferring to a variable. The output of the variable is given below:
schema.SchemaError("Key 'policy' error:\nOr({'name': And(<class 'str'>, <built-in function len>), 'age': And(<class 'int'>, <function <lambda> at 0x000001C964E92DC8>), Optional('gender'): And(<class 'str'>, Use(<method 'lower' of 'str' objects>), <function <lambda> at 0x000001C964E92E58>)}) did not validate {'name': 'Sue', 'age': 28, 'gnder': 'Squid'}\nWrong key 'gnder' in {'name': 'Sue', 'age': 28, 'gnder': 'Squid'}")
Please let me know how I can get the contents of this variable, I could try to convert this into a string but then it becomes very cumbersome to extract the contents. I specifically want the contents after 'did not validate' part.
EDIT - Not looking to resolve the error, error was expected. I transferred the contents of the exception to a variable, just need to figure out how to read the variable.