Skip to content

Commit 9d4f0a5

Browse files
committed
fix(read): fixing error message for integrity verification failures
1 parent 422a86d commit 9d4f0a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/content/read.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function read (cache, integrity, opts) {
2121
} else if (ssri.checkData(data, sri)) {
2222
return data
2323
} else {
24-
throw checksumError(sri, null)
24+
throw integrityError(sri, cpath)
2525
}
2626
})
2727
})
@@ -92,8 +92,8 @@ function sizeError (expected, found) {
9292
return err
9393
}
9494

95-
function checksumError (sri, path) {
96-
var err = new Error(`Checksum failed for ${sri} (${path})`)
95+
function integrityError (sri, path) {
96+
var err = new Error(`Integrity verification failed for ${sri} (${path})`)
9797
err.code = 'EINTEGRITY'
9898
err.sri = sri
9999
err.path = path

0 commit comments

Comments
 (0)