core&ui: add error & fix error notification (#464)

This commit is contained in:
panda authored and GitHub committed 2022-11-26 20:30:18 +08:00
1 parent a2ea3812df
commit 534a634028
14 files changed
+123 -76

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
import { omit, pick, throttle } from 'lodash';
import { FilterQuery, ObjectID } from 'mongodb';
import {
ContestNotAttendedError, ContestNotFoundError, ForbiddenError, PermissionError,
ContestNotAttendedError, ContestNotFoundError, HackRejudgeFailedError, PermissionError,
ProblemNotFoundError, RecordNotFoundError, UserNotFoundError,
} from '../error';
import { RecordDoc, Tdoc } from '../interface';
@@ -186,7 +186,7 @@ class RecordDetailHandler extends ContestDetailBaseHandler {
@param('rid', Types.ObjectID)
async post() {
this.checkPerm(PERM.PERM_REJUDGE);
if (this.rdoc.files?.hack) throw new ForbiddenError('Cannot rejudge a hack record.');
if (this.rdoc.files?.hack) throw new HackRejudgeFailedError();
}
@param('rid', Types.ObjectID)