这是我的python代码中的异常消息:
Common.AnimalClass.NestedClass: Id is not found
我想排除类名,只想打印如下消息:
Id is not found
我是python的新手, 如何在python3中实现这一目标?
if not (is_id_present):
self.log_step_status("FAIL", step_name)
log_message = 'id is not found'
raise TestCaseFailureError(log_message)
class TestCaseFailureError(Exception, vlogger):
"""Base Error class for tests"""
def __init__(self, *args, **kwargs):
self.vlog('Message: {0}', args[0])
Exception.__init__(self, *args, **kwargs)