diff options
Diffstat (limited to 'frontend/src')
| -rw-r--r-- | frontend/src/wsrouter.ts | 8 |
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; } } |
