Reputation: 23275
Generally, in software design, which of the options below is preferred when there is a problem or error with a resource such as a database or file?
For example, should the user see an empty DataGrid following which they complain, or should there be an error message? Which is better?
Upvotes: 0
Views: 382
Reputation: 55907
I don't see this as an either/or. Also, we need to consider all "users" of the system.
First consider the UI. Let's consider a contrived general case: you are populating a UI by calling a service which in turn uses a couple of of databases (for example a "current data" and an "historic data") database.
There are at least these possibilities:
Then also consider your application's semantics. Can your applciation procede in a "degraded" mode if all the data cannot be retrieved? For example, we can't query the history but that doesn't stop us creating a new item.,
Now also consider the roles here. There's the person using the UI, there's also support and maintenance people who need to know about and fix problems.
My general rules:
Historica Data not currently available
or
There are problems retrieveing information, if these persist please contact support ...
Upvotes: 2
Reputation: 43619
There are some pitfalls to each of the options
This is specially helpful when your application is in testing stage or public testing. Also when clients meets an error, he or she can copy down the details and forward to you.
However sometimes this error message gets very ugly (call stacks and so on - remember ASP.NET?) and it becomes so large that it becomes difficult for clients to copy down the details.
This is useful when you don't want error messages to cog up your software UI design. But be reminded that it becomes difficult and further error prone when clients can't differentiate between an actual error, or really nothing on the GUI. The error stays there and nothing gets fixed.
Get the best of both worlds. In fact most modern applications how have a very good error handling process. I'll take the example of Mozilla Firefox 3.
Or if the error is a warning or of lesser severity:
Show a simple error code and tell the user that there's the error with that action. Something like: "Error 123 at RequestSalary() Line 2"
Upvotes: 1
Reputation: 24472
IMO you should show a message (albeit a user friendly one and not something like "java.io.IOException: Connection timed out".) You could have a message box telling the user that an error occured while getting the data and provide helpful tips like: Trying after some time, check network cable, etc. Also allow user to report that error to you (error reporting build into the app) that will send you the actual error and stack trace.
Upvotes: 0
Reputation: 8258
The practice I usualy use is:
Upvotes: 0