Hello colleagues! Please share your experience, what rules do you use when you create an error message for the user when writing software. For example, the user is trying to download something from the network and put the result in the database. Accordingly, errors can occur both related to the network and to the database. Those. I would tell the user the following (for example):

  • Failed to load the list of posts: No access to the Internet

  • Could not load list of posts: Client error 404 not found

  • Failed to load the post list: Server error 500

  • Failed to load the list of posts: Error writing to the database

PS Is it possible to display a message from a caught exception?

Thank you for your responses!

    3 answers 3

    Put yourself in the place of a user who is not familiar with programming, are you interested in reading "Client error 404 not found", "Server error 500"?

    For such a user, the 504 Gateway Timeout is an abracadabra. He should be worried about when this problem will be fixed and how to continue working with your program.

    So, suppose the connection to the database has disappeared, then the user needs to display a message:

    "The data storage operation failed due to technical problems on our side. Try it in a few minutes."

    If the user has lost the Internet, then this is a slightly different error and it should show not only the presence of the Internet, but also brief information on how this problem can be solved. Maybe his firewall blocked?

    "We noticed that you lost connection to the Internet. Working offline with our program is impossible, check the connection to the Internet. If you do not see problems with opening pages in the browser, your access to the network might have been blocked by your antivirus software. programs and you need to check the rules "

    Also, you can make the tab "System Information" below and save information about the error, request data, etc. there. and write to the user:

    "If this problem persists for a long time, contact technical support with information from the 'System Information' tab"

      “Write the application as if it would be supported by a violent psychopath who knows where you live” (c) is not mine.

      Users are different in qualifications, in organizations with at least two people will work with your error message - in fact, the user and technical support officer, so you need the message to be useful to both of them (and you yourself at the debugging stage). Look at how the message log is organized in Windows - there is a brief description of the error in one line, which is shown in the list, and detailed with a bunch of information, understandable only to the developer.

      And I recommend reading Jacob Nielsen’s classic article “Error Message Guidelines Writing Rules ” ( Jakob Nielsen, “Error Message Guidelines” ).

        Errors associated with downloading data over the network, I divide into two types:

        1. Errors on the client side (problems with the Internet).
        2. Errors on the server side (its inoperability).

        In the first case, I tell the user that there are problems with the Internet and ask him to check his network connection.

        In the second case, I say that the requested site has some problems and I ask to check its performance in the browser.

        Regarding the output of the message from the caught exception: no, I think that it is not necessary to show it.

        In general, the question is rather subjective and strongly depends on the application being developed.