Repository navigation
Commit 2ee2c82
Replace VortexError's variants with a kind, and give every error one
VortexError carried one enum variant per dependency that could fail
(Arrow, FlatBuffers, ObjectStore, Jiff, Tokio, TryFromInt, Prost, Fmt)
plus two structural wrappers (Context, Shared). None were constructed by
name outside the `From` impls or matched on, and the only classification
callers could act on, the `vx_error_code` the C API exports, reported
OTHER for nearly everything: 1966 `vortex_err!` sites and all 1133
`vortex_ensure!` and `vortex_panic!` sites gave no kind at all. It was the
equivalent of a codebase that only ever raises bare `Exception`.
The error type
VortexError is now a struct holding a `VortexErrorKind`, a message, an
optional source and a backtrace, `Arc`-backed so it is cheaply `Clone`.
Errors from dependencies are classified by what they mean to Vortex and
kept as `Error::source`, where callers downcast. `Context` becomes a
message prefix that preserves kind, source and backtrace; `Shared` goes
away. `size_of::<VortexError>()` drops from 88 bytes to 56, and the `?`
conversion path no longer formats eagerly.
The kinds are the C API's existing codes with two additions and one
removal:
- NotFound, for a name lookup that found nothing: a missing field, an
unknown encoding id, an absent segment. Python raises KeyError here.
- Overflow, for a numeric value that will not fit its target, the largest
group that was hiding in Other. `From<TryFromIntError>` produces it, so
`?` on a `try_from` classifies itself.
- Compute is removed. Every other kind names what went wrong; Compute named
where it happened, which the enum's own docs say a kind must not do. Its
11 sites were all Overflow, MismatchedTypes or Serde.
NotFound and Overflow take C codes 10 and 11; Compute's slot 2 is retired
and not reused, so no existing code moves. cbindgen regenerated
cinclude/vortex.h and the hand-written C++ mirror in lang/cpp matches.
The macros
`vortex_err!`, `vortex_bail!`, `vortex_ensure!`, `vortex_ensure_eq!` and
`vortex_panic!` now require a leading `Kind:` before any message; the
untagged arm is replaced by a compile error naming the fix, with
compile_fail doctests keeping it that way. The three canned arms
(`MismatchedTypes: expected, actual` and the like) are gone: a literal
is an expr, so `vortex_bail!(MismatchedTypes: "Expected {:?}", x)`
matched the canned arm and rendered its braces verbatim. The 32 sites
that used them spell their message out. The macros no longer inject
`use std::backtrace::Backtrace;` into caller scope.
`vortex_ensure_eq!(a, b)` with no message still reports AssertionFailed,
showing both expressions and values. A check on the caller's input names
its kind alone, `vortex_ensure_eq!(a, b, InvalidArgument)`, and keeps that
output.
The sites
Every construction site now names its kind, each chosen by reading
the site. The rules that settle the ambiguous ones: a check on what the
caller passed in is InvalidArgument or MismatchedTypes, and a length
mismatch is never a type error; a check that a kernel, rewrite or executor
kept its own contract is AssertionFailed; a check made while decoding
metadata or a wire format is Serde; a child index nobody can satisfy is
OutOfBounds however it is phrased. Io covers operating-system and
device-driver calls, so the CUDA, nvcomp and CUB status failures are Io,
as Python's OSError would be. The sites left Other carry it explicitly,
so each reads as a decision.
`From<ArrowError>` sent every Arrow failure to Other; each variant now maps
to its kind (ArithmeticOverflow to Overflow, SchemaError to
MismatchedTypes, the file-format variants to Serde, and so on).
`From<jiff::Error>` maps a date that does not exist or a misused unit to
InvalidArgument. pco's Corruption and InsufficientData map to Serde.
44 sites wrapped an inner VortexError in a fresh `vortex_err!`, which
replaced its kind with a guess and nested its whole Display, backtrace
included, in the new message. A text scan cannot tell those from the same
shape around an io::Error, so a throwaway build probed every `map_err`
closure with a marker type whose must_use warning fires only for a
VortexError. The 29 that wrapped edition-registration calls lose the
`map_err`; the rest use `with_context`, or the `vortex_panic!(err, "...")`
form, which keep the kind. STYLE.md now says to do that.
Python
The Python bindings turned every VortexError into RuntimeError, so none of
this reached Python. Each kind now raises its analogue:
OutOfBounds IndexError
NotFound KeyError
Overflow OverflowError
InvalidArgument ValueError
Serde ValueError
MismatchedTypes TypeError
NotImplemented NotImplementedError
AssertionFailed AssertionError
Io OSError
Other RuntimeError
Signed-off-by: Robert Kruszewski <github@robertk.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S7EtMqoZ91rrCCh9vS2yTm1 parent c6e51ba commit 2ee2c82
714 files changed
Lines changed: 4831 additions & 4292 deletions
File tree
- encodings
- alp/src
- alp_rd
- alp
- compute
- bytebool/src
- datetime-parts/src
- compute
- decimal-byte-parts
- benches
- common
- src/decimal_byte_parts
- plugin
- fastlanes/src
- bitpacking
- array
- vtable
- delta
- array
- compute
- vtable
- for_
- array
- plugin
- vtable
- rle
- array
- vtable
- fsst/src
- compute
- dfa
- onpair/src
- compute
- parquet-variant/src
- pco/src
- runend/src
- compute
- sequence/src
- compute
- sparse/src
- compute
- uuid/src
- zigzag/src
- zstd/src
- fuzz
- fuzz_targets
- src
- array
- gpu
- lang/cpp
- include/vortex
- src
- vortex-array
- benches
- src
- aggregate_fn
- fns
- all_non_distinct
- bounded_max
- bounded_min
- count
- first
- is_constant
- is_sorted
- last
- mean
- min_max
- nan_count
- null_count
- sum_v2
- sum
- uncompressed_size_in_bytes
- arrays
- bool
- compute
- vtable
- chunked
- compute
- vtable
- constant
- compute
- vtable
- datetime
- decimal
- compute
- vtable
- dict
- vtable
- extension
- vtable
- filter
- execute
- take
- fixed_size_list
- compute
- vtable
- fixed_width
- take
- interleave
- execute
- listview
- vtable
- list
- compute
- vtable
- map
- compute
- vtable
- masked
- vtable
- null
- compute
- patched
- compute
- vtable
- piecewise_sequence
- primitive
- array
- compute
- vtable
- scalar_fn
- vtable
- slice
- struct_
- compute
- vtable
- union
- tests
- vtable
- varbinview
- compute
- vtable
- varbin
- compute
- vtable
- variant
- vtable
- array
- probe
- vtable
- builders
- dict
- compute/conformance
- dtype
- decimal
- extension
- serde
- expr
- analysis
- transform
- traversal
- extension
- datetime
- tests
- optimizer
- scalar_fn
- fns
- between
- binary
- compare
- numeric
- cast
- fill_null
- like
- list_contains
- mask
- not
- variant_get
- zip
- internal
- unstable/row
- batch
- execute
- execute
- types/element
- tuple
- visitor
- scalar
- convert
- tests
- typed_view
- decimal
- extension
- primitive
- session
- stats
- test_harness/trace
- vortex-arrow/src
- executor
- vortex-bench/src
- datasets
- statpopgen
- vector_dataset
- vortex-btrblocks
- src/schemes
- float
- integer
- tests
- vortex-buffer/src
- vortex-cloud/src/registry
- vortex-compressor/src
- compressor
- constant
- stats
- vortex-cuda
- benches
- ffi/src
- src
- arrow
- dynamic_dispatch
- hybrid_dispatch
- kernel
- arrays
- encodings
- filter
- patches
- slice
- pooled_read_at
- file
- vortex-datafusion
- examples
- src
- convert
- persistent
- v2
- vortex-duckdb/src
- convert
- duckdb
- exporter
- vortex-edition/src
- vortex-error
- src
- tests
- vortex-ffi
- cinclude
- examples
- src
- vortex-file
- src
- multi
- read
- segments
- tests/common
- vortex-io/src
- filesystem
- object_store
- request
- source
- runtime
- vortex-ipc/src
- messages
- vortex-jni/src
- io
- vortex-json/src
- vortex-layout/src
- layouts
- chunked
- dict
- flat
- foreign
- list
- row_idx
- struct_
- zoned
- aggregates/bloom_filter
- canonical
- partial
- plan
- optimizer
- plans
- scan
- segments
- vortex-mask/src
- vortex-python-cuda/src
- vortex-python
- src
- arrays
- py
- dtype
- iter
- object_store
- scalar
- test
- vortex-row/src
- vortex-scan/src
- planning
- vortex-session/src
- vortex-spatial/src
- aggregate_fn
- extension
- scalar_fn
- tests
- vortex-tensor/src
- scalar_fns
- types
- fixed_shape_tensor
- vector
- vortex-test/compat-gen/src
- fixtures
- arrays/datasets
- vortex-tui/src
- browse/ui
- vortex
- benches
- src/editions
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
280 | | - | |
| 279 | + | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
287 | | - | |
| 286 | + | |
| 287 | + | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
315 | 317 | | |
316 | 318 | | |
317 | 319 | | |
| |||
320 | 322 | | |
321 | 323 | | |
322 | 324 | | |
323 | | - | |
| 325 | + | |
324 | 326 | | |
325 | 327 | | |
326 | | - | |
| 328 | + | |
327 | 329 | | |
328 | 330 | | |
329 | 331 | | |
| |||
437 | 439 | | |
438 | 440 | | |
439 | 441 | | |
440 | | - | |
| 442 | + | |
441 | 443 | | |
442 | 444 | | |
443 | 445 | | |
444 | | - | |
| 446 | + | |
445 | 447 | | |
446 | 448 | | |
447 | 449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
173 | 171 | | |
174 | 172 | | |
175 | 173 | | |
| |||
213 | 211 | | |
214 | 212 | | |
215 | 213 | | |
216 | | - | |
217 | | - | |
218 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
219 | 217 | | |
220 | 218 | | |
221 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | | - | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
| |||
222 | 223 | | |
223 | 224 | | |
224 | 225 | | |
225 | | - | |
| 226 | + | |
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
| |||
476 | 477 | | |
477 | 478 | | |
478 | 479 | | |
479 | | - | |
| 480 | + | |
480 | 481 | | |
481 | 482 | | |
482 | | - | |
483 | | - | |
| 483 | + | |
| 484 | + | |
484 | 485 | | |
485 | 486 | | |
486 | | - | |
| 487 | + | |
487 | 488 | | |
488 | 489 | | |
489 | 490 | | |
490 | | - | |
| 491 | + | |
491 | 492 | | |
492 | 493 | | |
493 | 494 | | |
| |||
496 | 497 | | |
497 | 498 | | |
498 | 499 | | |
499 | | - | |
| 500 | + | |
500 | 501 | | |
501 | | - | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
502 | 507 | | |
503 | 508 | | |
504 | | - | |
| 509 | + | |
505 | 510 | | |
506 | 511 | | |
507 | 512 | | |
| |||
510 | 515 | | |
511 | 516 | | |
512 | 517 | | |
513 | | - | |
| 518 | + | |
514 | 519 | | |
515 | 520 | | |
516 | 521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
265 | | - | |
| 264 | + | |
| 265 | + | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| |||
0 commit comments