Fix unhandled rejection in differential updater

This commit is contained in:
Fedor Indutny 2023-02-13 12:27:12 -08:00 committed by GitHub
parent f9aaf30a32
commit 949efca190
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -368,15 +368,19 @@ export async function downloadRanges(
// Each `part` is a separate readable stream for one of the ranges
const onPart = async (part: Dicer.PartStream): Promise<void> => {
const diff = await takeDiffFromPart(part, diffByRange);
try {
const diff = await takeDiffFromPart(part, diffByRange);
await saveDiffStream({
diff,
stream: part,
abortSignal,
output,
chunkStatusCallback,
});
await saveDiffStream({
diff,
stream: part,
abortSignal,
output,
chunkStatusCallback,
});
} catch (error) {
dicer.destroy(error);
}
};
let boundary: string;