judge: friendly error

This commit is contained in:
undefined committed 2021-04-23 12:40:20 +08:00
1 parent c86b063415
commit b406b8989d
4 files changed
+6 -5

No files matched your search

+1 -1
View File
@@ -70,7 +70,7 @@ export default async function readYamlCases(cfg: Record<string, any> = {}, check
}
if (cfg.time) config.time = parseTimeMS(cfg.time);
if (cfg.memory) config.memory = parseMemoryMB(cfg.memory);
if (config.type === 'submit_answer' && !cfg.outputs) throw new Error('outputs config not found');
if (config.type === 'submit_answer' && !cfg.outputs?.length) throw new Error('outputs config not found');
return Object.assign(cfg, config);
}