diff --git a/server/routes/orbit/read.js b/server/routes/orbit/read.js index f633b6ce8..b5c534f99 100644 --- a/server/routes/orbit/read.js +++ b/server/routes/orbit/read.js @@ -250,8 +250,10 @@ router.get( const { application_id, keyword } = req.params; if (!application_id) throw Error("Invalid app ID"); - if (!typeof keyword === "string") throw Error("Invalid keyword"); - + if (!typeof keyword === "string") { + req.status(400).send("Invalid keyword"); + return; + } const query = `select Name from DimBuildInstance where Name like '%${keyword}%' and Name not like 'Scrub%' and EnvironmentName = 'Insurance' order by Name asc`; const result = await runSQLQuery(query, dbConfig);