mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 16:05:01 +02:00
Split OutputStream into ActionStream/OutputStream (#3304)
* Split OutputStream into ActionStream/OutputStream * Fmt * Missed update * Cleanup helper names * Fmt
This commit is contained in:
@ -310,6 +310,10 @@ impl PrettyDebug for ShellError {
|
||||
DbgDocBldr::error("Unknown Error")
|
||||
+ DbgDocBldr::delimit("(", DbgDocBldr::description(reason), ")")
|
||||
}
|
||||
ProximateShellError::Unimplemented { reason } => {
|
||||
DbgDocBldr::error("Unimplemented")
|
||||
+ DbgDocBldr::delimit("(", DbgDocBldr::description(reason), ")")
|
||||
}
|
||||
ProximateShellError::ExternalPlaceholderError => {
|
||||
DbgDocBldr::error("non-zero external exit code")
|
||||
}
|
||||
@ -600,6 +604,7 @@ impl ShellError {
|
||||
}
|
||||
|
||||
ProximateShellError::UntaggedRuntimeError { reason } => Some(Diagnostic::error().with_message(format!("Error: {}", reason))),
|
||||
ProximateShellError::Unimplemented { reason } => Some(Diagnostic::error().with_message(format!("Inimplemented: {}", reason))),
|
||||
ProximateShellError::ExternalPlaceholderError => None,
|
||||
}
|
||||
}
|
||||
@ -636,12 +641,16 @@ impl ShellError {
|
||||
}
|
||||
|
||||
pub fn unimplemented(title: impl Into<String>) -> ShellError {
|
||||
ShellError::untagged_runtime_error(&format!("Unimplemented: {}", title.into()))
|
||||
ShellError::unimplemented(&format!("Unimplemented: {}", title.into()))
|
||||
}
|
||||
|
||||
pub fn unexpected(title: impl Into<String>) -> ShellError {
|
||||
ShellError::untagged_runtime_error(&format!("Unexpected: {}", title.into()))
|
||||
}
|
||||
|
||||
pub fn is_unimplemented(&self) -> bool {
|
||||
matches!(self.error, ProximateShellError::Unimplemented { .. })
|
||||
}
|
||||
}
|
||||
|
||||
/// `ExpectedRange` describes a range of values that was expected by a command. In addition
|
||||
@ -747,6 +756,9 @@ pub enum ProximateShellError {
|
||||
UntaggedRuntimeError {
|
||||
reason: String,
|
||||
},
|
||||
Unimplemented {
|
||||
reason: String,
|
||||
},
|
||||
ExternalPlaceholderError,
|
||||
}
|
||||
|
||||
@ -779,6 +791,7 @@ impl HasFallibleSpan for ProximateShellError {
|
||||
ProximateShellError::Diagnostic(_) => return None,
|
||||
ProximateShellError::CoerceError { left, right } => left.span.until(right.span),
|
||||
ProximateShellError::UntaggedRuntimeError { .. } => return None,
|
||||
ProximateShellError::Unimplemented { .. } => return None,
|
||||
ProximateShellError::ExternalPlaceholderError => return None,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user