J
Jon Skeet [C# MVP]
Ilya Tumanov said:All errors are _your_ errors even if thrown from somebody else's code.
This is because these errors are result or _your_ actions.
Say, there's error in SMTP function. This is because _you_'re using SMTP
and something gone bad.
It's up to you to catch these exceptions and take corrective action and/or
display a high level message to your customer.
This message can not be technical like messages in System.SR.
It should explain what's going in terms your customers would understand.
You should also suggest corrective action if you can.
For example, you get System.IOException on attempt to read e-mail.
You should not just print out exception message (which would be "Unable to
read data from the transport connection").
Instead, you should:
1. Retry couple times.
2. If unsuccessful, print out message like this: "Could not get mail from
the server, please try again later or contact support at 555-1234".
And then support has the problem of not having the detailed error
message. If you could *optionally* also get the "Unable to read data
from the transport connection" that could quite possibly be helpful to
the support department.
Bottom line: your customer's don't need System.SR as it contains technical
messages for developers they would not understand.
It's up to you to provide adequate error description.
I disagree with this strongly. While it is certainly true that you
should give customers a non-technical error message, that *doesn't*
mean that they don't need System.SR. Our app, for instance, will log
exceptions, and the logs will be propagated to the server. This means
that any error messages can be read by a system administrator and, if
necessary, passed on to our support department.
The idea that a user app doesn't need to be able to get a detailed
technical error message is a really bad one, IMO. There's a difference
between presenting the user with it by default and being *able* to get
to it for troubleshooting purposes.