mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: change error type
This commit is contained in:
1 parent
f236af555b
commit
988140c244
2 files changed
+3
-1
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@hydrooj/hydrojudge",
|
||||
"bin": "bin/hydrojudge.js",
|
||||
"version": "2.5.5",
|
||||
"version": "2.5.6",
|
||||
"main": "package.json",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -98,6 +98,7 @@ export async function runMultiple(execute) {
|
||||
res = await axios.post('/run', body);
|
||||
if (argv['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(res.data));
|
||||
} catch (e) {
|
||||
if (e instanceof FormatError) throw e;
|
||||
throw new SystemError('Sandbox Error');
|
||||
}
|
||||
return await Promise.all(res.data.map((i) => adaptResult(i, {})));
|
||||
@@ -121,6 +122,7 @@ export async function run(execute, params?) {
|
||||
if (argv['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(res.data));
|
||||
[result] = res.data;
|
||||
} catch (e) {
|
||||
if (e instanceof FormatError) throw e;
|
||||
// FIXME request body larger than maxBodyLength limit
|
||||
throw new SystemError('Sandbox Error', e.message);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user