Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pkgs/id/src/meta_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn expect_ok(resp: MetaResponse) -> Result<MetaResponse> {
pub fn capped_response_error(err: ReadToEndError) -> anyhow::Error {
match err {
ReadToEndError::TooLong => anyhow::anyhow!(
"response too large: exceeds the {MAX_RESPONSE_BYTES}-byte limit (MAX_RESPONSE_BYTES)"
"response too large: exceeds the {MAX_RESPONSE_BYTES}-byte limit"
),
other => other.into(),
}
Expand Down Expand Up @@ -248,7 +248,10 @@ mod tests {
fn over_cap_error_names_the_limit() {
let err = capped_response_error(ReadToEndError::TooLong);
let msg = format!("{err}");
assert!(msg.contains("response too large"), "{msg}");
assert!(msg.contains(&MAX_RESPONSE_BYTES.to_string()), "{msg}");
assert_eq!(
msg,
format!("response too large: exceeds the {MAX_RESPONSE_BYTES}-byte limit"),
"the message must be exactly the named limit, with no leftover placeholder text"
);
}
}
Loading