further fixes to error reporting: extra context, disable colour

This commit is contained in:
りき萌 2025-09-10 16:10:27 +02:00
parent 3999dd3012
commit 6e666c0265
3 changed files with 13 additions and 5 deletions

View file

@ -36,11 +36,14 @@ export class ConnectionStatus extends HTMLElement {
showError(error) {
this.errorDialog.showModal();
if (typeof error.error == "string") {
this.errorText.value = error.error.toString();
}
if (error instanceof Error) {
if (error.stack != null && error.stack != "") {
this.errorText.textContent = `${error.toString()}\n\n${error.stack}`;
this.errorText.value = `${error.toString()}\n\n${error.stack}`;
} else {
this.errorText.textContent = error.toString();
this.errorText.value = error.toString();
}
}
}