Skip to content

Commit

Permalink
Renames error to be more specific
Browse files Browse the repository at this point in the history
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
  • Loading branch information
dcookspi committed Jul 23, 2024
1 parent ae1a4fe commit d5b3a69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/spk-solve/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub enum Error {
#[error("Error: {0}")]
String(String),
#[error("Error: {0} is not supported")]
NotSupported(String),
IncludingThisOutputNotSupported(String),
#[error("Error: Solver log file not created: {1} - {0}")]
SolverLogFileIOError(#[source] std::io::Error, PathBuf),
}
Expand Down
10 changes: 5 additions & 5 deletions crates/spk-solve/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -800,23 +800,23 @@ impl OutputKind {
match other_output {
OutputKind::Println => match self {
OutputKind::Println => Ok(self.clone()),
OutputKind::Tracing => Err(Error::NotSupported(
OutputKind::Tracing => Err(Error::IncludingThisOutputNotSupported(
"Cannot add Println output kind to a Tracing output kind. It".to_string(),
)),
OutputKind::LogFile(f) => Ok(OutputKind::PrintlnAndToFile(f.clone())),
OutputKind::PrintlnAndToFile(_) => Ok(self.clone()),
OutputKind::TracingAndToFile(_) => Err(Error::NotSupported(
OutputKind::TracingAndToFile(_) => Err(Error::IncludingThisOutputNotSupported(
"Cannot add Println output kind to a TrackingAndToFile output kind. It"
.to_string(),
)),
},
OutputKind::Tracing => match self {
OutputKind::Println => Err(Error::NotSupported(
OutputKind::Println => Err(Error::IncludingThisOutputNotSupported(
"Cannot add Tracing output kind to a Println output kind. It".to_string(),
)),
OutputKind::Tracing => Ok(self.clone()),
OutputKind::LogFile(f) => Ok(OutputKind::TracingAndToFile(f.clone())),
OutputKind::PrintlnAndToFile(_) => Err(Error::NotSupported(
OutputKind::PrintlnAndToFile(_) => Err(Error::IncludingThisOutputNotSupported(
"Cannot add Tracing output kind to a PrintlnAndToFile output kind. It"
.to_string(),
)),
Expand All @@ -825,7 +825,7 @@ impl OutputKind {
_ => {
// OutputKinds other than Println or Tracing are not
// valid for combining with the current output kind here.
Err(Error::NotSupported("OutputKind::ensure_output must be called with a Println or Tracing other_output. Including other kinds".to_string()))
Err(Error::IncludingThisOutputNotSupported("OutputKind::ensure_output must be called with a Println or Tracing other_output. Including other kinds".to_string()))
}
}
}
Expand Down

0 comments on commit d5b3a69

Please sign in to comment.