-
Notifications
You must be signed in to change notification settings - Fork 832
Respecting manual Message property in an Exception type definition #14352
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
Respecting manual Message property in an Exception type definition #14352
Conversation
psfinaki
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.
Cool, thanks for the intense testing :)
|
Fixes #1602 |
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.
Could you please check if both cases which are mentioned in #1602 are covered in tests to see if they're also fixed?
This thing works and is supported now: This thing is and never was valid F# (even if I replace Message with any other identifier, it is not specific to it): The "chatty" approach still works, however now it is of course a lot easier to simply name the property "Message" and do not deal with any override at all. |
|
Will crosspost to that issue as well. |
F# adds a Message property to each Exception, calling sprintfn "%A".
However, when either a custom field or a public property with the name Message is being added manually, it should win over the generated one and override what gets called on the Exception.Message property of the top level class.