Also reverts #3768
@ -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);