mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
chore(control): change visual error structure in api_handler
This commit is contained in:
@@ -238,7 +238,7 @@ async function request(
|
|||||||
error_description += '\nCould not parse error description';
|
error_description += '\nCould not parse error description';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
notifications.push('error', `Fehler ${response.status} bei API-Anfrage`, error_description);
|
notifications.push('error', `Fehler bei API-Anfrage`, `\nHTTP: ${response.status}\n${error_description}`);
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
if (error instanceof TypeError && /fetch|NetworkError/i.test(error.message)) {
|
if (error instanceof TypeError && /fetch|NetworkError/i.test(error.message)) {
|
||||||
if (dev) {
|
if (dev) {
|
||||||
@@ -272,8 +272,8 @@ function handle_shell_error(
|
|||||||
console.error(shell_response);
|
console.error(shell_response);
|
||||||
notifications.push(
|
notifications.push(
|
||||||
'error',
|
'error',
|
||||||
`Fehler ${shell_response.exitCode} in API-Shell`,
|
`Fehler in API-Shell`,
|
||||||
`${ip}\n${shell_command}\nFehler: ${shell_response.stderr}`
|
`${ip}\n${shell_command}\nFehler (${shell_response.exitCode}): ${shell_response.stderr}`
|
||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user