In this example I call fun3() in fun2(), but if something special happen in fun3() is there a way to directly return to fun1()? without having to check this special thing in fun2().
def fun1(num):
res = fun2(num)
# do something if fun3() return an error...
def fun2(num):
res = fun3(num) # if fun3(num) return a status:error return to fun(1)
# something else...
def fun3(num):
if type(num) is not int:
return {'status': 'error'}
else:
# something else...