From 53629eb8d910c5aa4204f3d59ac4537712d75b6e Mon Sep 17 00:00:00 2001 From: Navarjun Date: Tue, 7 Jun 2022 16:48:26 -0700 Subject: [PATCH] Remove catch predicate from server/api/canary/tags.js #14882 --- core/server/api/canary/tags.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/server/api/canary/tags.js b/core/server/api/canary/tags.js index 2de713c0d8b4..8c284bf0b225 100644 --- a/core/server/api/canary/tags.js +++ b/core/server/api/canary/tags.js @@ -149,10 +149,12 @@ module.exports = { query(frame) { return models.Tag.destroy(frame.options) .then(() => null) - .catch(models.Tag.NotFoundError, () => { - return Promise.reject(new errors.NotFoundError({ - message: tpl(messages.tagNotFound) - })); + .catch((e) => { + if (e instanceof models.Tag.NotFoundError) { + return Promise.reject(new errors.NotFoundError({ + message: tpl(messages.tagNotFound) + })); + } }); } }