From 747cb33f7df67976035b26cd98524ea0db441dea Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Wed, 14 Apr 2021 20:56:04 +0200 Subject: [PATCH] Change 502 to 500 --- source/app/web/instance.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/app/web/instance.mjs b/source/app/web/instance.mjs index 92d57353..0c5c6b74 100644 --- a/source/app/web/instance.mjs +++ b/source/app/web/instance.mjs @@ -201,7 +201,7 @@ if ((error instanceof Error)&&(/this may be the result of a timeout, or it could be a GitHub bug/i.test(error.errors?.[0]?.message))) { console.debug(`metrics/app/${login} > 502 (bad gateway from GitHub)`) const request = encodeURIComponent(error.errors[0].message.match(/`(?[\w:]+)`/)?.groups?.request ?? "").replace(/%3A/g, ":") - return res.status(502).send(`Bad Gateway: GitHub failed to execute request ${request} (this may be the result of a timeout, or it could be a GitHub bug)`) + return res.status(500).send(`Internal Server Error: failed to execute request ${request} (this may be the result of a timeout, or it could be a GitHub bug)`) } //General error console.error(error) @@ -289,7 +289,7 @@ if ((error instanceof Error)&&(/this may be the result of a timeout, or it could be a GitHub bug/i.test(error.errors?.[0]?.message))) { console.debug(`metrics/app/${login} > 502 (bad gateway from GitHub)`) const request = encodeURIComponent(error.errors[0].message.match(/`(?[\w:]+)`/)?.groups?.request ?? "").replace(/%3A/g, ":") - return res.status(502).send(`Bad Gateway: GitHub failed to execute request ${request} (this may be the result of a timeout, or it could be a GitHub bug)`) + return res.status(500).send(`Internal Server Error: failed to execute request ${request} (this may be the result of a timeout, or it could be a GitHub bug)`) } //General error console.error(error)