diff --git a/src/components/services/item.jsx b/src/components/services/item.jsx
index 56ed2b4b1..aa8e80962 100644
--- a/src/components/services/item.jsx
+++ b/src/components/services/item.jsx
@@ -85,7 +85,7 @@ export default function Item({ service }) {
{service.container && service.server && (
diff --git a/src/components/services/widget/error.jsx b/src/components/services/widget/error.jsx
index d12aebf21..cf5e13661 100644
--- a/src/components/services/widget/error.jsx
+++ b/src/components/services/widget/error.jsx
@@ -1,6 +1,5 @@
import { useTranslation } from "react-i18next";
import { IoAlertCircle } from "react-icons/io5";
-import classNames from "classnames";
function displayError(error) {
return JSON.stringify(error[1] ? error[1] : error, null, 4);
@@ -12,7 +11,7 @@ function displayData(data) {
export default function Error({ error }) {
const { t } = useTranslation();
-
+
if (error?.data?.error) {
error = error.data.error; // eslint-disable-line no-param-reassign
}
@@ -21,24 +20,24 @@ export default function Error({ error }) {
- {t("widget.api_error")} {t("widget.information")}
+ {t("widget.api_error")} {error.message && t("widget.information")}
- -
+ {error.message &&
-
{t("widget.api_error")}: {error.message}
-
- {error.url && -
+
}
+ {error.url && -
{t("widget.url")}: {error.url}
}
- {error.rawError && -
+ {error.rawError &&
-
{t("widget.raw_error")}:
{displayError(error.rawError)}
}
- {error.data && -
+ {error.data &&
-
{t("widget.response_data")}:
{displayData(error.data)}
diff --git a/src/pages/api/docker/stats/[...service].js b/src/pages/api/docker/stats/[...service].js
index ca8c8bd3a..d214ffb28 100644
--- a/src/pages/api/docker/stats/[...service].js
+++ b/src/pages/api/docker/stats/[...service].js
@@ -46,7 +46,7 @@ export default async function handler(req, res) {
});
} catch {
res.status(500).send({
- error: "unknown error",
+ error: {message: "Unknown error"},
});
}
}