https://dev.to/nebulagg/ai-agent-error-handling-4-resilience-patterns-in-python-12of