mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 17:46:28 +08:00
judge: friendly error
This commit is contained in:
1 parent
c86b063415
commit
b406b8989d
4 files changed
+6
-5
No files matched your search
@@ -180,6 +180,7 @@ async function readAutoCases(folder, { next }, cfg) {
|
||||
}
|
||||
|
||||
function isValidConfig(config) {
|
||||
if (config.type === 'submit_answer' && !config.outputs.length) throw new FormatError('Problem data not found.');
|
||||
if (config.count > (getConfig('testcases_max') || 100)) {
|
||||
throw new FormatError('Too many testcases. Cancelled.');
|
||||
}
|
||||
@@ -213,7 +214,7 @@ export default async function readCases(folder: string, cfg: Record<string, any>
|
||||
} catch (e) {
|
||||
throw changeErrorType(e, FormatError);
|
||||
}
|
||||
if (!(result.outputs || result.subtasks.length)) {
|
||||
if (!(result.outputs?.length || result.subtasks.length)) {
|
||||
const c = await readAutoCases(folder, args, config);
|
||||
result.subtasks = c.subtasks;
|
||||
result.count = c.count;
|
||||
|
||||
Reference in new issue
Block a user