From 36d1a2211bd1f0fa12fed0bb5cdaf0c819f59069 Mon Sep 17 00:00:00 2001 From: bignutty <3515180-bignutty@users.noreply.gitlab.com> Date: Wed, 24 Jul 2024 15:11:19 +0200 Subject: [PATCH] mirror backend error --- commands/interaction/slash/search/wolfram-alpha.js | 1 + commands/message/search/wolfram-alpha.js | 1 + 2 files changed, 2 insertions(+) diff --git a/commands/interaction/slash/search/wolfram-alpha.js b/commands/interaction/slash/search/wolfram-alpha.js index c5b22c7..edc1542 100644 --- a/commands/interaction/slash/search/wolfram-alpha.js +++ b/commands/interaction/slash/search/wolfram-alpha.js @@ -85,6 +85,7 @@ module.exports = { pages: formatPaginationEmbeds(pages) }); } catch (e) { + if(e.response.body?.error) return editOrReply(context, createEmbed("warning", context, e.response.body.error.message)) console.log(e) return editOrReply(context, createEmbed("error", context, `Unable to perform Wolfram|Alpha search.`)) } diff --git a/commands/message/search/wolfram-alpha.js b/commands/message/search/wolfram-alpha.js index e154db0..4a163f7 100644 --- a/commands/message/search/wolfram-alpha.js +++ b/commands/message/search/wolfram-alpha.js @@ -79,6 +79,7 @@ module.exports = { pages: formatPaginationEmbeds(pages) }); } catch (e) { + if(e.response.body?.error) return editOrReply(context, createEmbed("warning", context, e.response.body.error.message)) console.log(e) return editOrReply(context, createEmbed("error", context, `Unable to perform Wolfram|Alpha search.`)) }