Add Uptated-Prototype/Code-Snippets/ErrorMsg.py

This commit is contained in:
2026-01-01 05:00:15 -08:00
parent 36c1b1fb6e
commit 1ba297f719

View File

@@ -0,0 +1,13 @@
def ErrorMsg(string = None, exception = None):
try:
print(f"An Exception has occured when attempting to - {string}\nException: {exception}\nClass: {type(exception)}")
return True
except:
return False
#x = "Hello!"
try:
print(x)
except Exception as MyException:
print(ErrorMsg("Print", MyException))