From 3e2d271be2f197811dd8a2dfb505eb7e72bf62a5 Mon Sep 17 00:00:00 2001 From: beckerinj Date: Thu, 26 May 2022 19:08:35 +0300 Subject: [PATCH] 503 error if can not reach pm2 client --- periphery/src/routes/pm2.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/periphery/src/routes/pm2.ts b/periphery/src/routes/pm2.ts index f2f6eb95c..c02e831b2 100644 --- a/periphery/src/routes/pm2.ts +++ b/periphery/src/routes/pm2.ts @@ -9,7 +9,7 @@ const pm2 = fp((app: FastifyInstance, _: {}, done: () => void) => { const processes = await getPm2Processes(); res.send(processes); } catch { - res.status(400); + res.status(503); res.send("could not reach pm2 client"); } }); @@ -21,7 +21,7 @@ const pm2 = fp((app: FastifyInstance, _: {}, done: () => void) => { const cle = await getPm2Log(name); res.send(cle); } catch { - res.status(400); + res.status(503); res.send("could not reach pm2 client"); } } else { @@ -37,7 +37,7 @@ const pm2 = fp((app: FastifyInstance, _: {}, done: () => void) => { const cle = await startPm2(name); res.send(cle); } catch { - res.status(400); + res.status(503); res.send("could not reach pm2 client"); } } else { @@ -53,7 +53,7 @@ const pm2 = fp((app: FastifyInstance, _: {}, done: () => void) => { const cle = await stopPm2(name); res.send(cle); } catch { - res.status(400); + res.status(503); res.send("could not reach pm2 client"); } } else { @@ -69,7 +69,7 @@ const pm2 = fp((app: FastifyInstance, _: {}, done: () => void) => { const cle = await restartPm2(name); res.send(cle); } catch { - res.status(400); + res.status(503); res.send("could not reach pm2 client"); } } else { @@ -85,7 +85,7 @@ const pm2 = fp((app: FastifyInstance, _: {}, done: () => void) => { const cle = await deletePm2(name); res.send(cle); } catch { - res.status(400); + res.status(503); res.send("could not reach pm2 client"); } } else {