From 9d4f0a5eae6d8f8ac781a2829db34d37266a8261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Tue, 4 Apr 2017 23:24:31 -0700 Subject: [PATCH] fix(read): fixing error message for integrity verification failures --- lib/content/read.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/content/read.js b/lib/content/read.js index e7c78d0..5721c05 100644 --- a/lib/content/read.js +++ b/lib/content/read.js @@ -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) } }) }) @@ -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