Skip to content

Commit

Permalink
ignore if levelup/read-stream throws becasue we called stream.destroy…
Browse files Browse the repository at this point in the history
…() twice
  • Loading branch information
dominictarr committed Feb 28, 2013
1 parent 2b116ad commit f82277c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/db-opener.js
Expand Up @@ -62,7 +62,9 @@ module.exports = function (db) {
stream.once('end' , onReady)

emitter.once('dispose', function () {
stream.destroy()
//levelup/read-stream throws if the stream has already ended
//but it's just a user error, not a serious problem.
try { stream.destroy() } catch (_) { }
})

//write the update twice,
Expand Down

0 comments on commit f82277c

Please sign in to comment.