503 error if can not reach pm2 client

This commit is contained in:
beckerinj
2022-05-26 19:08:35 +03:00
parent 6d3f56a906
commit 3e2d271be2

View File

@@ -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 {