2018-07-04 00:54:11 -04:00
|
|
|
import { dialogBoxCreate } from "../DialogBox";
|
|
|
|
|
2019-01-10 00:20:04 -08:00
|
|
|
interface IError {
|
2021-04-29 23:52:56 -04:00
|
|
|
fileName?: string;
|
|
|
|
lineNumber?: number;
|
2019-01-10 00:20:04 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function exceptionAlert(e: IError): void {
|
2019-03-15 02:37:06 -07:00
|
|
|
console.error(e);
|
2018-07-04 00:54:11 -04:00
|
|
|
dialogBoxCreate("Caught an exception: " + e + "<br><br>" +
|
|
|
|
"Filename: " + (e.fileName || "UNKNOWN FILE NAME") + "<br><br>" +
|
|
|
|
"Line Number: " + (e.lineNumber || "UNKNOWN LINE NUMBER") + "<br><br>" +
|
|
|
|
"This is a bug, please report to game developer with this " +
|
|
|
|
"message as well as details about how to reproduce the bug.<br><br>" +
|
|
|
|
"If you want to be safe, I suggest refreshing the game WITHOUT saving so that your " +
|
2019-01-10 00:20:04 -08:00
|
|
|
"safe doesn't get corrupted", false);
|
2018-07-04 00:54:11 -04:00
|
|
|
}
|