mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-19 11:09:50 +00:00
Better error output for docker integration
This commit is contained in:
parent
c74b46712b
commit
c8116fc9e8
2 changed files with 18 additions and 14 deletions
|
@ -1,6 +1,9 @@
|
|||
import Docker from "dockerode";
|
||||
|
||||
import getDockerArguments from "utils/config/docker";
|
||||
import createLogger from "utils/logger";
|
||||
|
||||
const logger = createLogger("dockerStatusService");
|
||||
|
||||
export default async function handler(req, res) {
|
||||
const { service } = req.query;
|
||||
|
@ -68,9 +71,10 @@ export default async function handler(req, res) {
|
|||
return res.status(200).send({
|
||||
error: "not found",
|
||||
});
|
||||
} catch {
|
||||
} catch (e) {
|
||||
logger.error(e);
|
||||
return res.status(500).send({
|
||||
error: "unknown error",
|
||||
error: {message: e?.message ?? "Unknown error"},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue