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
+1 -1
View File
@@ -206,9 +206,9 @@
* bugfix: when trade ships captured don't render DONE 12/3/2024
* use mini A* for all pathfinding DONE 12/3/2024
* bugfix: gameStop not found error DONE 12/3/2024
* log stack traces & display them on screen DONE 12/3/2024
* record and replay games for debugging purposes
* bugfix: destroyers can't find path to dst and freeze
* log stack traces & display them on screen
* record single player game stats
* add radiation from nuke
* add cities
+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