You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support macro ensure_or_internal_err to clean up repeated sanity checks #15492
Is your feature request related to a problem or challenge?
When implementing complex logic, it's common to include assertions as sanity checks to catch potential errors.
The Rust assert!(...) macro will panic if the condition is false, but in most cases, we want to avoid panicking (which would crash the application). Instead, we prefer to return an internal error to indicate a potential bug. For example:
Perhaps we can create another forbid_or_internal_err for false assertions to make it more clear 🤔
I think this approach only cleaned things up a little, but this check-and-internal-err pattern is very common (used hundreds of times inside the current datafusion source), so I think this chore task is worth the effort.
changed the title [-]Support macro `ensore_or_internal_err` to clean up repeated sanity checks[/-][+]Support macro `ensure_or_internal_err` to clean up repeated sanity checks[/+]on Mar 30, 2025
Activity
[-]Support macro `ensore_or_internal_err` to clean up repeated sanity checks[/-][+]Support macro `ensure_or_internal_err` to clean up repeated sanity checks[/+]alan910127 commentedon Mar 30, 2025
take
refactor: Add `assert_or_internal_err!` macro for more ergonomic inte…
refactor: Add `assert_or_internal_err!` macro for more ergonomic inte…