Add error handling for Python Scripts