pub enum PreFlightError {
BinaryNotFound {
path: PathBuf,
},
ArgvExceedsArgMax {
total_bytes: usize,
arg_max: usize,
},
McpConfigInlineJsonRejected(String),
McpConfigPathMissing {
path: PathBuf,
},
McpConfigPathInvalidJson {
path: PathBuf,
error: String,
},
WalkUpMcpJsonInvalid {
path: PathBuf,
error: String,
},
OutputBufferTooSmall {
expected: usize,
configured: usize,
},
ClaudeConfigDirNotEmpty {
path: PathBuf,
reason: &'static str,
},
}Expand description
Structured errors from the pre-flight gate. Each variant carries the data needed for an operator to diagnose without re-running.
thiserror produces the Display impl that AppError::PreFlightFailed
captures into the detail field for i18n.
Variants§
BinaryNotFound
Binary at path does not exist on the filesystem.
ArgvExceedsArgMax
Total bytes of argv (binary + args + separators) exceed
ARG_MAX - 4096. Spawn would fail with E2BIG post-fork.
McpConfigInlineJsonRejected(String)
--mcp-config '{...}' was passed literally as the inline JSON.
Claude Code 2.1.177+ expects a filepath. Caller should use the
suggested_tempfile (already written with empty mcpServers map).
McpConfigPathMissing
--mcp-config <PATH> was passed but the path does not exist.
McpConfigPathInvalidJson
--mcp-config <PATH> was passed but the file is not valid JSON.
WalkUpMcpJsonInvalid
.mcp.json walk-up found an invalid file at path. Override
CLAUDE_CONFIG_DIR to an empty directory to suppress walk-up.
OutputBufferTooSmall
Caller’s expected output exceeds the documented JSON parser cap. The downstream parser truncates silently above this size.
ClaudeConfigDirNotEmpty
CLAUDE_CONFIG_DIR is set and settings.json declares active
mcpServers. Claude Code would load them and defeat
--strict-mcp-config --mcp-config <empty>. Hooks are NOT
flagged here because the spawners pass
--settings '{"hooks":{}}' which overrides the user-level
hooks at the CLI invocation boundary; MCP servers are NOT
overridden by any flag we pass, so they are the only class of
settings.json entry that can leak into the subprocess.
Trait Implementations§
Source§impl Debug for PreFlightError
impl Debug for PreFlightError
Source§impl Display for PreFlightError
impl Display for PreFlightError
Source§impl Error for PreFlightError
impl Error for PreFlightError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<PreFlightError> for AppError
Bridges the structured PreFlightError produced by the
pre-flight validation gate (v1.0.87, ADR-0045) into the unified
AppError envelope. Lets spawners use the ? operator instead
of hand-rolling AppError::PreFlightFailed { source: ... } at every
call site, and keeps the variant alive as the canonical exit code 16
path rather than the dead code it was at v1.0.87.
impl From<PreFlightError> for AppError
Bridges the structured PreFlightError produced by the
pre-flight validation gate (v1.0.87, ADR-0045) into the unified
AppError envelope. Lets spawners use the ? operator instead
of hand-rolling AppError::PreFlightFailed { source: ... } at every
call site, and keeps the variant alive as the canonical exit code 16
path rather than the dead code it was at v1.0.87.
Source§fn from(source: PreFlightError) -> Self
fn from(source: PreFlightError) -> Self
Auto Trait Implementations§
impl Freeze for PreFlightError
impl RefUnwindSafe for PreFlightError
impl Send for PreFlightError
impl Sync for PreFlightError
impl Unpin for PreFlightError
impl UnsafeUnpin for PreFlightError
impl UnwindSafe for PreFlightError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.