From 5b6592869b62368226caa23db7cd13206bd6f04c Mon Sep 17 00:00:00 2001 From: Bigsk Date: Wed, 18 Nov 2020 15:46:35 +0800 Subject: [PATCH] Some Small Updates :) --- core.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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)