Split OutputStream into ActionStream/OutputStream (#3304)

* Split OutputStream into ActionStream/OutputStream

* Fmt

* Missed update

* Cleanup helper names

* Fmt
This commit is contained in:
Jonathan Turner
2021-04-12 14:35:01 +12:00
committed by GitHub
parent dbecbdccd4
commit 5f550a355b
250 changed files with 1006 additions and 926 deletions

View File

@ -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,
})
}