From 24fd545c1a72a6dafb8b30ffb4f993eceef06ec7 Mon Sep 17 00:00:00 2001 From: Zane Perry Date: Tue, 10 Oct 2023 16:34:03 -0600 Subject: [PATCH] Minor error handling --- lib/plugins/pluginEndpoints.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/plugins/pluginEndpoints.js b/lib/plugins/pluginEndpoints.js index 081e6256..9495c24f 100644 --- a/lib/plugins/pluginEndpoints.js +++ b/lib/plugins/pluginEndpoints.js @@ -55,7 +55,7 @@ module.exports = function (req, res) { }).then(response => { return res.status(200).send(response.data) }).catch(error => { - return res.status(error.status).send('The plugin ' + name + ' status endpoint is not responding. Check that the plugin is active and running. ' + error) + return res.status(500).send('The plugin ' + name + ' status endpoint is not responding. Check that the plugin is active and running. ' + error) }) } @@ -87,7 +87,7 @@ module.exports = function (req, res) { } return res.status(200).send(response.data) }).catch(error => { - return res.status(error.status).send('The plugin ' + name + ' evaluate endpoint is not responding. Check that the plugin is active and running. ' + error) + return res.status(500).send('The plugin ' + name + ' evaluate endpoint is not responding. Check that the plugin is active and running. ' + error) }) } @@ -137,7 +137,7 @@ module.exports = function (req, res) { return res.status(200).send(response.data) }).catch(error => { res.header('Content-Type', 'text/plain') - return res.status(error.status).send(error) + return res.status(500).send(error) }) }