Skip to content
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

refactor: Extract planner errors to dedicated file #1034

Merged
merged 5 commits into from
Jan 16, 2023

Conversation

AndrewSisley
Copy link
Contributor

Relevant issue(s)

Part of #257

Description

Extracts planner errors to dedicated files (includes mapper). Continuation of work done at the end of last year whilst waiting on other discussions to progress.

@AndrewSisley AndrewSisley added area/errors Related to the internal management or design of our error handling system refactor This issue specific to or requires *notable* refactoring of existing codebases and components action/no-benchmark Skips the action that runs the benchmark. labels Jan 16, 2023
@AndrewSisley AndrewSisley added this to the DefraDB v0.5 milestone Jan 16, 2023
@AndrewSisley AndrewSisley requested a review from a team January 16, 2023 19:44
@AndrewSisley AndrewSisley self-assigned this Jan 16, 2023
Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM.

Just a question (non-blocking), what do you mean by:

"...the cleanliness of the eventual error is unimportant..." in: 92acd60 (#1034)

@AndrewSisley
Copy link
Contributor Author

Overall LGTM.

Just a question (non-blocking), what do you mean by:

"...the cleanliness of the eventual error is unimportant..." in: 92acd60 (#1034)

It should never reach users, and any error that does will be meaningless to them - at somepoint stuff like that can be wrapped with something generic like "Whoops something went wrong, hopefully all your data is still there, please send the below stacktrace to support"

@AndrewSisley AndrewSisley force-pushed the sisley/refactor/I257-mv-planner-errs branch from 72cb863 to 50974cc Compare January 16, 2023 21:37
I checked, we have tests that check this and they never reach this line
Code path cannot be reached, cannot be tested, and can only be introduced via internal programming error (in which case a later error will be about as useful)
Variable can not be nil, it is internal only and will always have a value unless an earlier error is silently skipped (in which case the cleanliness of the eventual error is unimportant)
Variable can not be nil, it is internal only and will always have a value unless an earlier error is silently skipped (in which case the cleanliness of the eventual error is unimportant)
@AndrewSisley AndrewSisley merged commit cb36b2d into develop Jan 16, 2023
@AndrewSisley AndrewSisley deleted the sisley/refactor/I257-mv-planner-errs branch January 16, 2023 21:55
shahzadlone pushed a commit that referenced this pull request Apr 13, 2023
* Remove impossible error (on create)

I checked, we have tests that check this and they never reach this line

* Remove impossible error (internal, colName)

Code path cannot be reached, cannot be tested, and can only be introduced via internal programming error (in which case a later error will be about as useful)

* Remove impossible error (explain.plan)

Variable can not be nil, it is internal only and will always have a value unless an earlier error is silently skipped (in which case the cleanliness of the eventual error is unimportant)

* Remove impossible error (request.plan)

Variable can not be nil, it is internal only and will always have a value unless an earlier error is silently skipped (in which case the cleanliness of the eventual error is unimportant)

* Extract planner errors to dedicated file
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
* Remove impossible error (on create)

I checked, we have tests that check this and they never reach this line

* Remove impossible error (internal, colName)

Code path cannot be reached, cannot be tested, and can only be introduced via internal programming error (in which case a later error will be about as useful)

* Remove impossible error (explain.plan)

Variable can not be nil, it is internal only and will always have a value unless an earlier error is silently skipped (in which case the cleanliness of the eventual error is unimportant)

* Remove impossible error (request.plan)

Variable can not be nil, it is internal only and will always have a value unless an earlier error is silently skipped (in which case the cleanliness of the eventual error is unimportant)

* Extract planner errors to dedicated file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/errors Related to the internal management or design of our error handling system refactor This issue specific to or requires *notable* refactoring of existing codebases and components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants