Applications in the Common Desktop Environment follow a common
model for presenting error messages and warnings. Users running
your application expect messages to be displayed in message footers,
error dialog boxes, or warning dialog boxes, with further explanations
available in online help, when appropriate.
This section outlines conventions for displaying error messages
in your application. Because of the way message text is handled,
it is important to follow these error presentation guidelines precisely.
For example, casual users who start your application from the Front
Panel never see messages that you send to standard error or standard
out. In the Common Desktop Environment, such messages are directed
to log files ($HOME/.dt/*log)
that many users do not routinely examine or know about.
How to Present Error Messages |
 |
Follow these rules when deciding where to tell users about
warnings, messages, and error conditions:
If this
message is informational, display the text in the message
footer of the application. (Example: "MyDoc
file copied.")
If this message is about an error or serious
warning—a problem where an operation important
to the user has failed—display an error dialog box or warning
dialog box.
What Information to Present
in Error Dialogs |
 |
A good error dialog or warning dialog gives a user the following
information:
What happened (from
the user's point of view)
Why it happened, in simple language
Linking Message Dialogs
to Online Help |
 |
In cases where additional background information is required,
or where it takes more than four or five lines of a dialog to completely
explain an error, add a button that links the user to the appropriate
section of online help.
For details on displaying error messages in your application
and linking message dialogs to online help, see the Programmer's
Guide .
Using Message Logging |
 |
The message logging service logs messages for CDE applications.
This service provides a central location for messages that users
and system administrators can consult to diagnose problems.
The message logging service supports several message types:
Informational, Stderr, Debug, Warning, and Error. In addition to
logging messages, the API supports the use of alternative message
logging handlers and the ability to open message log files.