Skip to content

Commit 15efebd

Browse files
committed
LocalStore::addToStore(): Reinstate try/catch
`skip()` can throw an exception, which we need to ignore since we may be unwinding an exception.
1 parent 35a8e60 commit 15efebd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/libstore/local-store.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,12 @@ void LocalStore::addToStore(const ValidPathInfo & info, Source & source, RepairF
10491049
bool narRead = false;
10501050
Finally cleanup = [&]() {
10511051
if (!narRead)
1052-
source.skip(info.narSize);
1052+
try {
1053+
source.skip(info.narSize);
1054+
} catch (...) {
1055+
// TODO: should Interrupted be handled here?
1056+
ignoreExceptionInDestructor();
1057+
}
10531058
};
10541059

10551060
addTempRoot(info.path);

0 commit comments

Comments
 (0)