diff --git a/core.py b/core.py index d5f6638..a4a5c2c 100644 --- a/core.py +++ b/core.py @@ -41,7 +41,7 @@ class GMCLCore(object): ''':Type Type of the log info''' ''':Text The main text of log info''' ''':Function The function that cause the log,the default value is "Anonymous Function"''' - ''':Type The type of the error,the default value is "TypeError"''' + ''':Type The type of the error,the default value is "TypeError",Support "TypeError","ValueError","UserWarning"''' if(Text!="" or None): if(Type=="info"): self.__Log.append(("INFO",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Function,Text)) @@ -51,7 +51,12 @@ class GMCLCore(object): return ("WARN",Text) elif(Type=="error"): self.__Log.append(("ERROR",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Function,Text,ErrorType)) - raise TypeError(Text) + if(ErrorType=="TypeError"): + raise TypeError(Text) + elif(ErrorType=="ValueError"): + raise ValueError(Text) + else: + raise UserWarning(Text) else: self.__Log.append(("OTHER",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Function,Text)) return ("OTHER",Text)