judge: change error type

pull/118/head
undefined 4 years ago
parent f236af555b
commit 988140c244

@ -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);
}

Loading…
Cancel
Save