try: print('a') raise ValueError('主动抛出异常!') # 错误类型ValueError可以改成你想要的 except ValueError as ex: print(ex) except Exception as ex: print(ex) else: print('b') finally: print('c')