mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-28 05:36:34 +00:00
Merge pull request #2430 from resin-io/fix-blockmap-checksum-error
fix(writer): Set EVALIDATION on blockmap checksum errors
This commit is contained in:
commit
8c870f2db8
@ -515,6 +515,12 @@ class ImageWriter extends EventEmitter {
|
|||||||
const pipeline = this._createVerifyPipeline(destination)
|
const pipeline = this._createVerifyPipeline(destination)
|
||||||
|
|
||||||
pipeline.on('error', (error) => {
|
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)
|
this.emit('error', error)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user