Skip to main content

is_invalid_input

Function is_invalid_input 

Source
pub fn is_invalid_input(err: &Error) -> bool
Expand description

Whether err is an input rejection — a bad caller argument, encoded as an Error::Spawn whose source is io::ErrorKind::InvalidInput. This is the pattern the toolkit’s own argument guards raise (reject_flag_like and the validating newtypes RefName/RevSpec/RevsetExpr) for a value that would be misparsed as a flag, is empty, or contains a NUL — and it also covers the spawn-time InvalidInput the OS raises for an un-spawnable argument (an interior NUL in a flag-value, or Windows’ batch-arg-escaping refusal). All are genuine bad input, distinct from a real spawn failure (missing binary → NotFound, no perms → PermissionDenied) or a non-zero exit. A binding maps this to a ValueError; the facades re-expose it as Error::is_invalid_input().