-
Notifications
You must be signed in to change notification settings - Fork 663
Improve error reporting for invalid column-type-changing automigrations #3202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
So the structured errors already exist in |
In that case I'm happy to merge without worrying about using |
Not sure what the value of those TODOs are. I don't think they should be implemented, as all of the datastore is fail-fast and doesn't gather errors. If we want to change that I think we should do it as part of a larger plan. |
Mm, fair. I'll remove. |
Per request from @Centril
Description of Changes
Title. When validating column type changes in
Table::change_columns_toand comparing layouts inRowTypeLayout::is_compatible_with, return structured error objects which describe the mismatch.I made this change while debugging the issue that led to #3203 , where
change_columns_toreturned an error during replay of an automigration which had succeeded the first time. The original error contained enough information to debug, but it was presented in a noisy and unhelpful way, so I wrote this patch to get better diagnostics.Per @Centril 's comments, these errors are for internal assertions, not user-facing error reporting, so we value fail-fast rather than error hygiene and choose not to use the
ErrorStreamcombinator.Also note that I sprinkled
Boxes around some large-ish error types to quiet https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err .API and ABI breaking changes
N/a
Expected complexity level and risk
Testing
Manual testing with BitCraft. As this is purely altering the error reporting for non-user-facing assertions, I don't believe any further testing is necessary.