From c516342a21e9c0847b27d2a4759ad3fd9db1a510 Mon Sep 17 00:00:00 2001 From: Yang Gao <6821729+criyle@users.noreply.github.com> Date: Sun, 19 May 2024 12:39:29 +0800 Subject: [PATCH] judge: distinguish sandbox error between old version and not running (#813) --- packages/hydrojudge/src/sandbox.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/hydrojudge/src/sandbox.ts b/packages/hydrojudge/src/sandbox.ts index 7f68fa749..e91d5ccc6 100644 --- a/packages/hydrojudge/src/sandbox.ts +++ b/packages/hydrojudge/src/sandbox.ts @@ -230,7 +230,8 @@ export async function versionCheck(reportWarn: (str: string) => void, reportErro const config = await client.config(); sandboxCgroup = config.runnerConfig?.cgroupType || 0; } catch (e) { - reportError('Your sandbox version is tooooooo low! Please upgrade!'); + if (e?.syscall === 'connect') reportError('Connecting to sandbox failed, please check sandbox_host config and if your sandbox is running.'); + else reportError('Your sandbox version is tooooooo low! Please upgrade!'); return false; } const { osinfo } = await sysinfo.get();