diff --git a/lib/sdk/writer/index.js b/lib/sdk/writer/index.js index 391f9ea1..177c5162 100644 --- a/lib/sdk/writer/index.js +++ b/lib/sdk/writer/index.js @@ -515,6 +515,12 @@ class ImageWriter extends EventEmitter { const pipeline = this._createVerifyPipeline(destination) pipeline.on('error', (error) => { + // NOTE: As the `blockmap` module doesn't set our custom error codes, + // we need to patch `EVALIDATION` into a range checksum error here + if (error.message && error.message.startsWith('Invalid checksum for range')) { + error.code = 'EVALIDATION' + this.emit('fail', { device: destination.device.device, error }) + } this.emit('error', error) })