You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
539681fffd
From now on, all new tests must use underscore. Addresses issue #727.
23 lines
376 B
Python
23 lines
376 B
Python
class MyExc(Exception):
|
|
pass
|
|
|
|
e = MyExc(100, "Some error")
|
|
print(e)
|
|
print(repr(e))
|
|
print(e.args)
|
|
|
|
try:
|
|
raise MyExc("Some error")
|
|
except MyExc as e:
|
|
print("Caught exception:", repr(e))
|
|
|
|
try:
|
|
raise MyExc("Some error2")
|
|
except Exception as e:
|
|
print("Caught exception:", repr(e))
|
|
|
|
try:
|
|
raise MyExc("Some error2")
|
|
except:
|
|
print("Caught user exception")
|