mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
parent
0dc2f2e18a
commit
9ede44b12d
@ -15,7 +15,7 @@ export default function Component({ service }) {
|
||||
return <Container service={service} error={infoError} />;
|
||||
}
|
||||
|
||||
if (!infoData || infoData.errorCode) {
|
||||
if (!infoData) {
|
||||
return (
|
||||
<Container service={service}>
|
||||
<Block label="wgeasy.connected" />
|
||||
|
@ -69,7 +69,15 @@ export default async function wgeasyProxyHandler(req, res) {
|
||||
},
|
||||
);
|
||||
|
||||
return res.json(JSON.parse(data));
|
||||
const parsedData = JSON.parse(data);
|
||||
|
||||
if (parsedData.statusCode > 400) {
|
||||
return res
|
||||
.status(parsedData.statusCode)
|
||||
.json({ error: { message: "Error communicating with Wg-Easy", data: parsedData } });
|
||||
}
|
||||
|
||||
return res.json(parsedData);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user