Skip to content

Commit

Permalink
fix: error/help messages (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
infiniteregrets authored Dec 23, 2024
1 parent 04b33d5 commit af18134
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ miette = { version = "7.2.0", features = ["fancy"] }
rand = "0.8.5"
serde = { version = "1.0.214", features = ["derive"] }
serde_json = "1.0.132"
streamstore = "0.5.0"
streamstore = "0.5.1"
thiserror = "2.0.6"
tokio = { version = "1.41.1", features = ["full"] }
tokio-stream = { version = "0.1.16", features = ["io-util"] }
Expand Down
9 changes: 4 additions & 5 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn parse_maybe_basin_or_uri(
}
Err(parse_basin_err) => {
// Should definitely be a URI else error.
let uri = http::Uri::from_str(s).map_err(|_| parse_basin_err)?;
let uri = http::Uri::from_str(s).map_err(|_| parse_basin_err.clone())?;

match uri.scheme_str() {
Some("s2") => (),
Expand All @@ -45,10 +45,9 @@ fn parse_maybe_basin_or_uri(
)));
}
None => {
return Err(BasinNameOrUriParseError::InvalidUri(miette::miette!(
help = "Make sure the URI starts with 's2://'",
"Missing URI scheme"
)))
// It's probably not an attempt to enter a URI. Safe to
// assume this is simply an invalid basin.
return Err(parse_basin_err.into());
}
};

Expand Down

0 comments on commit af18134

Please sign in to comment.