Skip to content

Commit c47904a

Browse files
committed
Better error message in case of unknown encoding id
Signed-off-by: Robert Kruszewski <[email protected]>
1 parent 1e91494 commit c47904a

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎vortex-array/src/serde.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ impl SerializedArray {
329329
if session.allows_unknown() {
330330
return self.decode_foreign(encoding_id, dtype, len, ctx);
331331
}
332-
return Err(vortex_err!("Unknown encoding: {}", encoding_id));
332+
vortex_bail!("Unknown encoding: {}", encoding_id);
333333
};
334334

335335
let children = SerializedArrayChildren {

‎vortex-layout/src/children.rs‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,14 @@ impl LayoutChildren for ViewedLayoutChildren {
218218
let encoding_id = self
219219
.layout_read_ctx
220220
.resolve(fb_child.encoding())
221-
.ok_or_else(|| vortex_err!("Encoding not found: {}", fb_child.encoding()))?;
221+
.ok_or_else(|| {
222+
vortex_err!("Unknown layout encoding index: {}", fb_child.encoding())
223+
})?;
222224
let Some(encoding) = self.layouts.find(&encoding_id) else {
223225
if self.allow_unknown {
224226
return viewed_children.foreign_layout_from_fb(fb_child, dtype);
225227
}
226-
return Err(vortex_err!(
227-
"Encoding not found in registry: {}",
228-
fb_child.encoding()
229-
));
228+
vortex_bail!("Unknown layout encoding: {encoding_id}");
230229
};
231230

232231
let build_ctx = LayoutBuildContext {

0 commit comments

Comments
 (0)