Change error handling from throwing an exception to returning a boolean value#384
Merged
williamdes merged 3 commits intophpmyadmin:6.0.xfrom Sep 9, 2022
Merged
Conversation
williamdes
added a commit
to annexus254/sql-parser
that referenced
this pull request
Aug 8, 2022
Pull-request: phpmyadmin#384 Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes
added a commit
to annexus254/sql-parser
that referenced
this pull request
Aug 8, 2022
Pull-request: phpmyadmin#384 Signed-off-by: William Desportes <williamdes@wdes.fr>
e840d83 to
f136780
Compare
In case an error occurs during loading of a context, let the Context::load() method return a boolean value indicating whether the context was successfully loaded or not. Throwing an Exception causes a false positive in debuggers,since the Context::load() method does the correct thing anyway
Pull-request: phpmyadmin#384 Signed-off-by: William Desportes <williamdes@wdes.fr>
Pull-request: phpmyadmin#384 Signed-off-by: William Desportes <williamdes@wdes.fr>
Codecov Report
@@ Coverage Diff @@
## 6.0.x #384 +/- ##
============================================
- Coverage 95.20% 95.20% -0.01%
+ Complexity 2162 2161 -1
============================================
Files 66 65 -1
Lines 4591 4588 -3
============================================
- Hits 4371 4368 -3
Misses 220 220
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
f136780 to
233788b
Compare
williamdes
approved these changes
Aug 8, 2022
Member
williamdes
left a comment
There was a problem hiding this comment.
Thank you for your contribution !
I rebased it onto 6.0.x that will be the next major version to be released, since this change may be a breaking change for some users.
I also fixed the test for this and added a CHANGELOG.md entry
MauricioFauth
approved these changes
Sep 9, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In case an error occurs during loading of a context, let the Context::load()
method return a boolean value indicating whether the context was successfully
loaded or not.
Throwing an Exception causes a false positive in debuggers,since the Context::load()
method does the correct thing anyway