mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-12 16:08:48 +00:00
Add detailed Error component for service widgets
This commit is contained in:
parent
7b7740563e
commit
21017e4716
37 changed files with 113 additions and 113 deletions
|
@ -11,8 +11,9 @@ export default function Component({ service }) {
|
|||
|
||||
const { data: torrentData, error: torrentError } = useWidgetAPI(widget);
|
||||
|
||||
if (torrentError) {
|
||||
return <Container error={t("widget.api_error")} />;
|
||||
if (torrentError || torrentData?.error) {
|
||||
const finalError = torrentError ?? torrentData.error;
|
||||
return <Container error={finalError} />;
|
||||
}
|
||||
|
||||
if (!torrentData) {
|
||||
|
|
|
@ -68,6 +68,7 @@ export default async function transmissionProxyHandler(req, res) {
|
|||
|
||||
if (status !== 200) {
|
||||
logger.error("Error getting data from Transmission: %d. Data: %s", status, data);
|
||||
return res.status(500).send({error: {message:"Error getting data from Transmission", url, data}});
|
||||
}
|
||||
|
||||
if (contentType) res.setHeader("Content-Type", contentType);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue