vjudge: catch error on running (#610)

This commit is contained in:
panda authored and GitHub committed 2023-07-07 22:41:06 +08:00
1 parent 44373794f6
commit 8f8647f3ee
1 file changed
+2 -1
+2 -1
View File
@@ -16,7 +16,7 @@ class AccountService {
problemLists: Set<string>; problemLists: Set<string>;
listUpdated = false; listUpdated = false;
working = false; working = false;
error = null; error = '';
constructor(public Provider: BasicProvider, public account: RemoteAccount) { constructor(public Provider: BasicProvider, public account: RemoteAccount) {
this.api = new Provider(account, async (data) => { this.api = new Provider(account, async (data) => {
@@ -25,6 +25,7 @@ class AccountService {
this.problemLists = Set.union(this.api.entryProblemLists || ['main'], this.account.problemLists || []); this.problemLists = Set.union(this.api.entryProblemLists || ['main'], this.account.problemLists || []);
this.main().catch((e) => { this.main().catch((e) => {
logger.error(`Error occured in ${account.type}/${account.handle}`); logger.error(`Error occured in ${account.type}/${account.handle}`);
this.working = false;
this.error = e.message; this.error = e.message;
console.error(e); console.error(e);
}); });