Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
fix(read): fixing error message for integrity verification failures
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Apr 5, 2017
1 parent 422a86d commit 9d4f0a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/content/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function read (cache, integrity, opts) {
} else if (ssri.checkData(data, sri)) {
return data
} else {
throw checksumError(sri, null)
throw integrityError(sri, cpath)
}
})
})
Expand Down Expand Up @@ -92,8 +92,8 @@ function sizeError (expected, found) {
return err
}

function checksumError (sri, path) {
var err = new Error(`Checksum failed for ${sri} (${path})`)
function integrityError (sri, path) {
var err = new Error(`Integrity verification failed for ${sri} (${path})`)
err.code = 'EINTEGRITY'
err.sri = sri
err.path = path
Expand Down

0 comments on commit 9d4f0a5

Please sign in to comment.