summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorParty Wumpus <48649272+PartyWumpus@users.noreply.github.com>2024-02-22 17:37:20 +0000
committerParty Wumpus <48649272+PartyWumpus@users.noreply.github.com>2024-02-22 17:37:20 +0000
commit637e3c566e3aee04c57de008a0a0a8b5e95b447f (patch)
treec3cb6adf01aa42d3328b47006bdfb83e755a6803 /frontend
parent89a4a69f6da706a0cd8c4036bc1aa4c6e44f6e11 (diff)
downloaddecky-loader-637e3c566e3aee04c57de008a0a0a8b5e95b447f.tar.gz
decky-loader-637e3c566e3aee04c57de008a0a0a8b5e95b447f.zip
what if the error message was better
Diffstat (limited to 'frontend')
-rw-r--r--frontend/src/wsrouter.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/frontend/src/wsrouter.ts b/frontend/src/wsrouter.ts
index e3a6900b..34184a7f 100644
--- a/frontend/src/wsrouter.ts
+++ b/frontend/src/wsrouter.ts
@@ -34,12 +34,20 @@ interface ErrorMessage {
id: number;
}
+/**
+ * An error from a python call
+ */
export class PyError extends Error {
pythonTraceback: string | null;
constructor(name: string, message: string, traceback: string | null) {
super(message);
this.name = `Python ${name}`;
+ if (traceback) {
+ // traceback will always start with `Traceback (most recent call last):`
+ // so this will make it say `Python Traceback (most recent call last):` after the JS callback
+ this.stack = this.stack + '\n\nPython ' + traceback;
+ }
this.pythonTraceback = traceback;
}
}