-
Notifications
You must be signed in to change notification settings - Fork 12
Make TreeSitterError inherit Exception #83
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
DerekStride
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be surprising to me as a user of the gem. Why don't we want them to be handled by default rescue blocks?
|
Thanks for replying, I was hoping you'd see it today :)
Take I would argue that I understand that the standard practice is to inherit WDYT? |
DerekStride
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue that SymbolNotFoundError and QueryCreationError are also similar in nature, in the sense that if you get them, then you're doing something deeply wrong
Hmm, the others make more sense now that you've laid it out. I'm still on the fence about these ones but also don't have strong feelings.
News.md
Outdated
| # v1.9.2 (05-12-2024) | ||
|
|
||
| - Make `TreeSitter::TreeSitterError < Exception` instead of `StandardErorr`; | ||
| we don't want them to be handled by default `rescue`. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could arguably be a breaking change. I think we should at least bump to v1.10.0 or even v2.0.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with that. Let's bump to 1.10.0. I prefer bumping major when tree-sitter breaks some APIs, but I'm not religious about that. You prefer 2.0.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.10.0 is good with me 👍
We don't want our exceptions to go unnoticed or handled by default
rescue.Consumers need to handle them explicitly.