Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upGuidance for what to write in Error::description() #71
Comments
This comment has been minimized.
This comment has been minimized.
Enet4
commented
May 25, 2017
That's quite a claim. Can you provide some examples of what would be a good practice here? I would actually imagine certain implementations of |
This comment has been minimized.
This comment has been minimized.
|
Sure we can make exceptions for the person implementing
But the point is that a user of the library should never have an error value and decide to call Guidelines for where |
This comment has been minimized.
This comment has been minimized.
Kixunil
commented
May 31, 2017
|
I personally find |
This comment has been minimized.
This comment has been minimized.
|
@Kixunil you're missing out! Display can usually be much more informative than description. |
This comment has been minimized.
This comment has been minimized.
Kixunil
commented
May 31, 2017
|
@dtolnay I actually do it like this: |
This comment has been minimized.
This comment has been minimized.
|
Okay great. That is what #71 (comment) means by "You can call |
This comment has been minimized.
This comment has been minimized.
Kixunil
commented
May 31, 2017
|
Yes, I understand. What I want to say is that |
This comment has been minimized.
This comment has been minimized.
|
I agree. |
dtolnay
added
the
new guideline
label
Sep 18, 2017
This comment has been minimized.
This comment has been minimized.
|
Added a note about description() in 0c5f968. |
dtolnay commentedMay 24, 2017
My understanding is that nothing should ever use description(). Most errors will have a significantly more helpful Display representation than what the signature of description() allows.
Nevertheless, description() is there and has to return something.