I'm using a plain Exception rather than a more specific type because I don't know what errors exactly a third party library might throw upon a bad response. If I wanted to use their more specific library specific types, I would have to depend on them (e.g. to catch Claude errors, I'd have to depend on anthropic_py, or whatever Anthropic's Python package is called.) For now, I don't want to do that.
I'm using a plain
Exception
rather than a more specific type because I don't know what errors exactly a third party library might throw upon a bad response. If I wanted to use their more specific library specific types, I would have to depend on them (e.g. to catch Claude errors, I'd have to depend onanthropic_py
, or whatever Anthropic's Python package is called.) For now, I don't want to do that.