-
-
Notifications
You must be signed in to change notification settings - Fork 485
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
Include start / end in exceptions thrown by type inspector #624
Include start / end in exceptions thrown by type inspector #624
Conversation
3f3c232
to
573515f
Compare
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 think including the location of the error is a useful improvement, however I don't think that changing ITypeInspector
to take a scalar is a good idea for the following reasons:
- That interface should not be coupled to YAML structure. It is an abstraction over the .NET type system. In principle it could be used in contexts that have nothing to do with YAML.
- This is a breaking change that will force anyone who implements that interface to change their code.
ITypeInspector
is a frequently used extension point, so the impact would be high.
Instead I would suggest to catch the exception(s) and wrap them. In principle, this would also be a breaking change, although I believe that the impact would be quite low as I don't expect code to rely on these exceptions specifically.
What do you think?
@aaubry As it was not massively used in the solution I thought that maybe it was an internal interface.I tried my luck! ☺ By the way there is this nice analyzer to detect breaking changes in the public API: Please note that I'm currently using We could accumulate the serialization errors and wrap them in a new exception type like |
573515f
to
87118e7
Compare
Hi @aaubry, I changed the code accordingly to your remarks, what do you think about it? |
Sorry, I missed your review request. I'll review it asap. |
Thanks and sorry for the delay! |
Thx! Let me know when you release a version with the fix. |
Hi @aaubry any plans to release a version including this fix? |
This feature has been released in version 12.0.0. |
Start
/End
in exception thrown by type inspector