mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
fix: fail open on insaits monitor errors
This commit is contained in:
parent
b40de37ccb
commit
1c2d5dd389
2 changed files with 37 additions and 1 deletions
|
|
@ -98,6 +98,16 @@ process.stdin.on('end', () => {
|
|||
process.exit(0);
|
||||
}
|
||||
|
||||
// The monitor only uses 0 (pass) and 2 (block). Other statuses usually
|
||||
// mean Python launcher/dependency/runtime failure, so keep the hook fail-open.
|
||||
if (result.status !== 0 && result.status !== 2) {
|
||||
const detail = (result.stderr || result.stdout || '').trim();
|
||||
const suffix = detail ? `: ${detail}` : '';
|
||||
process.stderr.write(`[InsAIts] Security monitor exited with status ${result.status}${suffix}\n`);
|
||||
process.stdout.write(raw);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (result.stdout) {
|
||||
process.stdout.write(result.stdout);
|
||||
} else if (result.status === 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue