mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 14:01:58 +00:00
what if the error message was better
This commit is contained in:
@@ -34,12 +34,20 @@ interface ErrorMessage {
|
|||||||
id: number;
|
id: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An error from a python call
|
||||||
|
*/
|
||||||
export class PyError extends Error {
|
export class PyError extends Error {
|
||||||
pythonTraceback: string | null;
|
pythonTraceback: string | null;
|
||||||
|
|
||||||
constructor(name: string, message: string, traceback: string | null) {
|
constructor(name: string, message: string, traceback: string | null) {
|
||||||
super(message);
|
super(message);
|
||||||
this.name = `Python ${name}`;
|
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;
|
this.pythonTraceback = traceback;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user