What is the best practice in multifile error handling?

  python, python-3.x, refactoring, solid-principles

I have written pretty big project in python and started my first refactoring using SOLID principles. Could you advice me some good practice in multifile error handling? I dont know where to put my try catch block to keep my code clean and readable. My code needs to work 24/7 in scheduler loop so there cannot be unhandled exception and there is a lot of validators. Oversimplified code to picture:

import schedule
import time

def f1_step1():
    #do something
    pass

def f1_step2():
    #do something
    pass

def data_validation(data):
    #return result
    pass
    

def f1():
    data=f1_step1()
    if(!data_validation(data))
        break
    f1_step2()
    
schedule.every(10).minutes.do(f1)

while True:
    schedule.run_pending()
    time.sleep(1)

Source: Python-3x Questions

LEAVE A COMMENT