ComposerRepository: catch(Exception) too broad in publish loop #39

Closed
opened 2026-06-22 18:40:22 +00:00 by starsetbyte · 0 comments
Owner

What

ComposerRepository.publish() line 154 catches Exception broadly in the post-publish loop. This swallows non-recoverable errors alongside legitimate network/API failures.

Fix

Narrowed to IOException (network failures) and HttpException (non-2xx API responses). CancellationException is still re-thrown separately. Other unexpected exceptions now propagate naturally rather than being caught and potentially wrapped in PartialPublishException.

Added import retrofit2.HttpException.

Fixed in current working tree.

## What `ComposerRepository.publish()` line 154 catches `Exception` broadly in the post-publish loop. This swallows non-recoverable errors alongside legitimate network/API failures. ## Fix Narrowed to `IOException` (network failures) and `HttpException` (non-2xx API responses). `CancellationException` is still re-thrown separately. Other unexpected exceptions now propagate naturally rather than being caught and potentially wrapped in `PartialPublishException`. Added `import retrofit2.HttpException`. **Fixed in current working tree.**
Sign in to join this conversation.
No description provided.