Skip to content

isShellCommandFailedError

isShellCommandFailedError(e): e is ShellCommandFailedError

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/shell/ShellCommandFailedError.ts:65

Recognise a ShellCommandFailedError for an agent’s softening middleware.

Prefers a plain instanceof (thrower and catcher share this one core module, so the class identity is the same), but falls back to a STRUCTURAL check keyed on name === 'ShellCommandFailedError' plus the carried fields. The structural arm is deliberate defence against a dual-package / realm-boundary hazard: if the error ever crossed a module boundary that broke instanceof, we would otherwise silently rethrow a real shell failure and regress the ✗ signal. Every field the softener reads (output) is asserted so a narrowed value is safe to use.

unknown

e is ShellCommandFailedError