From 604b42c7efed3a51255056148c18d95f98f37a9d Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 21 Oct 2021 13:28:20 -0600 Subject: [PATCH] chore!: drop really, really old node support --- README.md | 7 +++++-- lib/errors.js | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a4b34b2..2b880b1 100644 --- a/README.md +++ b/README.md @@ -301,7 +301,10 @@ For backwards compatibility with v1, the non-stringified `message` is the same a Minor Breaking changes (with a major version bump): -- v3.0.0 - reworked error messages (also available in v2.1.0 as `client_message`) -- v2.0.0 - changes from the default `issuers = ["*"]` to requiring that an issuer (or public jwk for verification) is specified +- v3.0.0 + - reworked error messages (also available in v2.1.0 as `client_message`) + - started using `let` and template strings (drops _really_ old node compat) +- v2.0.0 + - changes from the default `issuers = ["*"]` to requiring that an issuer (or public jwk for verification) is specified See other changes in [CHANGELOG.md](./CHANGELOG.md). diff --git a/lib/errors.js b/lib/errors.js index 26cf543..820f5a4 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -22,8 +22,9 @@ function create(old, msg, code, status, details) { /** @type AuthError */ //@ts-ignore - var err = new Error(old); - err.client_message = msg; + let err = new Error(msg); + err.message = msg; + err._old_message = old; err.code = code; err.status = status; if (details) {