judge: change error type

This commit is contained in:
undefined committed 2021-04-19 13:21:52 +08:00
1 parent f236af555b
commit 988140c244
2 files changed
+3 -1

No files matched your search

+2
View File
@@ -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);
}