class AlexError(Exception):
def __init__(self, msg):
self.message = msg
# def __str__(self):
# return 'sdfsf'
try:
raise AlexError('数据库连不上')
except AlexError as e:
print(e)
转载于:https://www.cnblogs.com/rongye/p/9967949.html
class AlexError(Exception):
def __init__(self, msg):
self.message = msg
# def __str__(self):
# return 'sdfsf'
try:
raise AlexError('数据库连不上')
except AlexError as e:
print(e)
转载于:https://www.cnblogs.com/rongye/p/9967949.html