Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
refactor(python): collapse redundant download error handlers, cover both
Review follow-up on the download size cap. `requests.exceptions.RequestException` subclasses `OSError`, so the two handlers added for the write loop were byte-identical and the second already subsumed the first. Collapse them into one `except OSError` and say why in a comment, so the next reader does not re-add the redundant clause. Route partial-file cleanup through `_discard_partial_download`, which suppresses cleanup failures: an `OSError` from `unlink` would otherwise replace the `ResponseTooLargeError` or transport error the caller needs. Cover the two error paths that had no tests: a transport failure mid-stream and a failing write both raise `ErrorDownloadingFile` and leave no partial file behind. Without the handler the write failure escapes as a raw `OSError(28)` — the defect these pin. Claude-Session: https://claude.ai/code/session_01K1hH9PMmd6KPKdkACX553z