diff --git a/lib/persistence.js b/lib/persistence.js index a60a80f..50a77d3 100755 --- a/lib/persistence.js +++ b/lib/persistence.js @@ -215,7 +215,8 @@ class Persistence { lineStream.on('end', () => { // A bit lenient on corruption if (length > 0 && corruptItems / length > this.corruptAlertThreshold) { - const err = new Error('More than ' + Math.floor(100 * this.corruptAlertThreshold) + '% of the data file is corrupt, the wrong beforeDeserialization hook may be used. Cautiously refusing to start NeDB to prevent dataloss') + const corruptPercent = Math.floor(100 * this.corruptAlertThreshold) + const err = new Error(`More than ${corruptPercent}% of the data file is corrupt, the wrong beforeDeserialization hook may be used. Cautiously refusing to start NeDB to prevent dataloss`) cb(err, null) return }