KK
Size: a a a
KK
RB
RB
VD
F
VD
# LIB func and class
def action(func):
def func_wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except Exception as e:
args[0].process_exception(e)
raise
return func_wrapper
class A():
@action
def get(self):
return 1
def process_exception(self, e):
print('Base process exception')
# backend class
class SuperA(A):
def process_exception(self, e):
print('SuperA process exception')
# do SQL upadtes here
# main
sa = SuperA()
print(sa.get())
RB
VD
AS
AS
KK
KK
💭П
AS
AS
KK
KK
SZ