alert on stack trace

This commit is contained in:
Evan
2024-12-03 20:15:30 -08:00
parent ec155dcb84
commit 019635e523
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -173,7 +173,14 @@ export class GameRunner {
}
this.isProcessingTurn = true
this.gs.addExecution(...this.executor.createExecs(this.turns[this.currTurn]))
this.gs.executeNextTick()
try {
this.gs.executeNextTick()
throw Error("test")
} catch (error) {
const errorText = `Error: ${error.message}\nStack: ${error.stack}`;
alert("Game crashed! Error info copied to clipboard. Please paste this in your bug report in Discord.");
navigator.clipboard.writeText(errorText);
}
this.renderer.tick()
this.currTurn++
this.isProcessingTurn = false