相关的知识点:raise 可以抛出一个异常,定义类的时候继承Exception
class MyError(Exception): ##继承了父类Exception pass #... ... raise(MyError)