Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: always close writer so iterator throws on error (#3980)
Browse files Browse the repository at this point in the history
When `traverseWrite` throws (abort signal for example), the writer is never closed and the iterator never ends.
  • Loading branch information
alanshaw committed Dec 15, 2021
1 parent 6eeaca4 commit d147494
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/ipfs-core/src/components/dag/export.js
Expand Up @@ -59,9 +59,10 @@ export function createExport ({ repo, preload, codecs }) {
cid,
writer,
codecs)
writer.close()
} catch (/** @type {any} */ e) {
err = e
} finally {
writer.close()
}
})()

Expand Down

0 comments on commit d147494

Please sign in to comment.