-
-
Notifications
You must be signed in to change notification settings - Fork 505
Bring back stack trace to YamlException.ToString #1000
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
base: master
Are you sure you want to change the base?
Conversation
/// <summary> | ||
/// Gets the reason that originated the exception. | ||
/// </summary> | ||
public string Reason { get; } | ||
|
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.
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.
How InnerException suppose to be related to reason? Reason is just plain text description what caused the error.
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.
Oh, sorry, I must have been drunk when looking at this. On second look this all makes sense. Apologies again!
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.
Sorry again about the confusion earlier! After a good night's sleep, this all makes sense and looks like it's a very good solution. I'd consider adding a test checking that ToString contains the inner exception as well, but otherwise this is perfect.
Testing |
Suppose that's right. I saw it as a way to express "desired behavior". Sure, it's obvious that the code does what it should, it's a typed language, but having a test case saying "YamlException stringification doesn't hide the inner exception" seemed as a useful regression test. Doesn't matter that much though. |
Any chance of getting this merged? |
This PR introduce
Reason
property inYamlException
to bring back default functionality ofToString
method.Fixes #999