Closed kukuro-kt closed 10 months ago
As a comparison, C#'s error messages are much more useful:
System.IO.FileNotFoundException: Could not find file '\...\...\a.txt'.
File name: '\...\...\a.txt'
at...
@shepmaster Could you please share or explain your objections? Or Integer 32, LLC
does not answer anything unless paid?
There are dozens of issues, questions and discussions about this exact issue or issues adjacent to this.
https://github.com/rust-lang/rfcs/pull/3084 is an example of one such in this repository. Although that one only covers filesystem errors, the arguments for or against making this change for other error types are the same. Closing as a duplicate.
Current std errors are very vague. For example:
If any one file of them does not exist, we will only get this message:
This message does not contain filepath and have no help for debug. We have to use
.map_err(...)
or something else to convert it to our own error like this:Also,
will only give a vague error:
instead of
Almost all std errors do not provide any details about parameter and cannot be used directly, we have to handle these errors like
go
language in an ugly way.In addition, some std errors have the first letter capitalized, some errors do not. Some std errors have a period at the end and some do not. This is confusing too.