# -*- coding: UTF-8 -*- #自定义异常学了半天也没学懂 class LinException(Exception): def __init__(self,msg): self.message = msg def __str__(self): return "123" name = [] try: raise LinException("我的异常") except LinException as e: print(e)