standards.info: Errors

Go forward to User Interfaces
Go backward to Libraries
Go up to Program Behavior
Go to the top op standards

Formatting Error Messages

   Error messages from compilers should look like this:
     SOURCE-FILE-NAME:LINENO: MESSAGE
   Error messages from other noninteractive programs should look like
this:
     PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE
when there is an appropriate source file, or like this:
     PROGRAM: MESSAGE
when there is no relevant source file.
   In an interactive program (one that is reading commands from a
terminal), it is better not to include the program name in an error
message.  The place to indicate which program is running is in the
prompt or with the screen layout.  (When the same program runs with
input from a source other than a terminal, it is not interactive and
would do best to print error messages using the noninteractive style.)
   The string MESSAGE should not begin with a capital letter when it
follows a program name and/or file name.  Also, it should not end with
a period.
   Error messages from interactive programs, and other messages such as
usage messages, should start with a capital letter.  But they should not
end with a period.