There is a database-based application at work with an authorization system. If a user is not logged in, the only system accessible to them is the authorization system where they must provide a valid username and password that are stored in the database.

The login function has the following comment in it:

// NOTE: This is the only place in the program that will given an error about
// the DSN not being properly configured/connected, because this is the only 
// place where that is a cause for concern - the other queries can only be 
// accessed once the user is logged in, and once they are logged in, they 
// obviously have a valid connection to the database.

Indeed, the other queries in this program do not include a detailed error displayed to the user about a database failure; if there is any sort of error, it is silently logged to a file for the IT and programming staff to analyze.

Is this a good design decision?

  • 1
    How "silent" is "silent"? If a database failure during a save operation leads to data loss, but the end user is not even notfied with a simple message like "something went wrong, ask your IT staff for help", this is not a good decision. – Doc Brown May 31 '17 at 20:43
  • @DocBrown as I clarified in my comment in Lukasz' answer, there is a generic "database failure" error shown to the user, but unlike the error message about the DSN being invalid, it does not contain instructions for troubleshooting. – Govind Parmar May 31 '17 at 20:45
  • 1
    Can the IT and programming staff reach the log file, or do they need the help of the end user to get it? – Doc Brown May 31 '17 at 20:47

Well, read the comment again -

This is the only place in the program that will given an error about the DSN not being properly configured/connected

If it was only the


part, that would be probably ok - if DSN point's to wrong DB you will not be able to login and continue. But the second part


is deeply troubling. In real world network connection issues do happen, and while it might not make sense do show end user the whole error call-stack, they should definitely be notified that sth. went wrong and, for example, their from / data has been not saved / processed / whatever. Just out of curiosity, is this some UI application? How are errors handled? Is there really no information to the end user that sth went wrong?

  • Erm, there is a generic "MessageBox" type error, but it's not terribly useful for troubleshooting like the error that is logged to the file, and the error that contains instructions on how to configure the DSN. – Govind Parmar May 31 '17 at 20:42
  • 3
    @GovindParmar: so there is message box for the end user, and a detailed information in a file? Why should the end user be bothered with debugging information? – Doc Brown May 31 '17 at 20:45
  • @Doc Brown is right, the end user does not need to know the details, especially if they are a non-technical people. Though sometimes, it's nice to add a functionality, where detailed information can be easily put into error report / ticket, just to avoid tickets with screenshots of call stack (yuck). – Łukasz Zwierko May 31 '17 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.