sbt/util-cache/src/main
BitToby e0bdb531f7
[2.x] fix: Widen IOException catch in organicTask to cover result serialization (#9050)
**Problem**
When a file referenced during cache serialization is deleted between task
execution and cache storage, sbt crashes with an uncaught NoSuchFileException.
The IOException catch added in #8699 only wraps store.put(), but
Converter.toJsonUnsafe(result) and mkInput() also call
hashedVirtualFileRefToStr which calls Files.readAttributes — and these are
outside the try-catch.

**Solution**
Move the try/catch IOException to wrap the entire post-action cache storage
section, so NoSuchFileException from result serialization or cache key
computation is caught and handled gracefully (skip caching, return result).

Fixes #9044

Co-authored-by: bittoby <218712309+bittoby@users.noreply.github.co>
2026-04-10 01:44:08 -04:00
..
contraband [2.x] feat: Cache failed compilation to avoid repeated failures (#8490) 2026-01-12 16:03:05 -05:00
contraband-scala/sbt [2.x] feat: Cache failed compilation to avoid repeated failures (#8490) 2026-01-12 16:03:05 -05:00
scala/sbt [2.x] fix: Widen IOException catch in organicTask to cover result serialization (#9050) 2026-04-10 01:44:08 -04:00