Skip to content

Commit

Permalink
Slightly nicer unknown encodings error (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 authored Oct 9, 2024
1 parent 5859f5d commit b822b6e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions vortex-array/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,9 @@ impl ArrayView {

let encoding = ctx.lookup_encoding(array.encoding()).ok_or_else(
|| {
let pretty_known_encodings = ctx.encodings().map(|e| format!("- {}", e.id()))
.collect::<Vec<String>>()
.join("\n");
vortex_err!(InvalidSerde: "Unknown encoding with ID {:#02x}. Known encodings:\n{}", array.encoding(),
pretty_known_encodings
)
let pretty_known_encodings = ctx.encodings()
.format_with("\n", |e, f| f(&format_args!("- {}", e.id())));
vortex_err!(InvalidSerde: "Unknown encoding with ID {:#02x}. Known encodings:\n{pretty_known_encodings}", array.encoding())
},
)?;

Expand Down

0 comments on commit b822b6e

Please sign in to comment.