judge: throw FormatError when problem data not found

This commit is contained in:
undefined committed 2021-12-11 15:52:13 +08:00
1 parent 785dcc1628
commit 00402f2782
5 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -182,7 +182,7 @@ export default class Hydro {
const [domainId, pid] = source.split('/');
const filePath = path.join(getConfig('cache_dir'), this.config.host, source);
await fs.ensureDir(filePath);
if (!files?.length) throw new SystemError('Problem data not found.');
if (!files?.length) throw new FormatError('Problem data not found.');
let etags: Record<string, string> = {};
try {
etags = JSON.parse(fs.readFileSync(path.join(filePath, 'etags')).toString());