Add error handling in index
This commit is contained in:
parent
5cb1f2b879
commit
b9d6ebc45d
@ -5,6 +5,7 @@ import { Executor } from './Executor';
|
||||
import { ControlPanel } from './ControlPanel';
|
||||
import TxtVersion from '!!raw-loader!./version.txt';
|
||||
|
||||
function main() {
|
||||
const logger = new ConsoleLogger('Travian');
|
||||
|
||||
logger.log('TRAVIAN AUTOMATION', TxtVersion);
|
||||
@ -22,3 +23,10 @@ if (modeDetector.isAuto()) {
|
||||
const controlPanel = new ControlPanel(TxtVersion, scheduler);
|
||||
controlPanel.run();
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
main();
|
||||
} catch (e) {
|
||||
setTimeout(() => location.reload(), 5000);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user