From f49e9029e949abe3b4013c1bfc432e99389bec70 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sat, 5 Dec 2020 23:10:48 +0100 Subject: [PATCH] Improve error message --- src/claims.js | 2 +- test/claims.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/claims.js b/src/claims.js index 3d1b813..ad31a26 100644 --- a/src/claims.js +++ b/src/claims.js @@ -159,7 +159,7 @@ const verify = async (input, fingerprint, opts) => { opts = mergeOptions(defaultOpts, opts ? opts : {}) if (!validUrl.isUri(uri)) { - throw new Error('Not a valid URI') + throw new Error('Invalid URI') } const spMatches = serviceproviders.match(uri, opts) diff --git a/test/claims.test.js b/test/claims.test.js index c5b6b19..0f7f2b6 100644 --- a/test/claims.test.js +++ b/test/claims.test.js @@ -64,11 +64,11 @@ describe('claims.verify', () => { }) it('should throw an error for non-valid URIs', () => { return expect(doipjs.claims.verify('noURI')).to.eventually.be.rejectedWith( - 'Not a valid URI' + 'Invalid URI' ) return expect( doipjs.claims.verify('domain.org') - ).to.eventually.be.rejectedWith('Not a valid URI') + ).to.eventually.be.rejectedWith('Invalid URI') }) doipjs.serviceproviders.list.forEach((spName, i) => {