bitburner-src/src/utils/helpers/exceptionAlert.ts

26 lines
758 B
TypeScript
Raw Normal View History

2021-09-25 20:42:57 +02:00
import { dialogBoxCreate } from "../../ui/React/DialogBox";
2019-01-10 09:20:04 +01:00
interface IError {
2021-09-05 01:09:30 +02:00
fileName?: string;
lineNumber?: number;
2019-01-10 09:20:04 +01:00
}
2021-09-25 00:29:25 +02:00
export function exceptionAlert(e: IError | string): void {
2021-09-05 01:09:30 +02:00
console.error(e);
dialogBoxCreate(
"Caught an exception: " +
e +
"<br><br>" +
"Filename: " +
2021-09-25 00:29:25 +02:00
((e as any).fileName || "UNKNOWN FILE NAME") +
2021-09-05 01:09:30 +02:00
"<br><br>" +
"Line Number: " +
2021-09-25 00:29:25 +02:00
((e as any).lineNumber || "UNKNOWN LINE NUMBER") +
2021-09-05 01:09:30 +02:00
"<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 " +
"safe doesn't get corrupted",
);
}