Error Messages
Error messages are messages that are related to the daemon as a whole rather than a particular job. For example, an out of memory condition my generate an error message. They should be very rarely needed. In general, you should be using Job and Job Queued messages (Jmsg and Qmsg). They are coded as:
EmsgN(error-code, level, message, arg1, …) As with debug messages, you must explicitly code the of arguments to be substituted in the message. Error-code indicates the severity or class of error, and it may be one of the following (See table 1.1):
Code |
Meaning |
---|---|
M_ABORT |
Causes the daemon to immediately abort. This should be used only in extreme cases. It attempts to produce a traceback. |
M_ERROR_TERM |
Causes the daemon to immediately terminate. This should be used only in extreme cases. It does not produce a traceback. |
M_FATAL |
Causes the daemon to terminate the current job, but the daemon keeps running. |
M_ERROR |
Reports the error. The daemon and the job continue running. |
M_WARNING |
Reports a warning message. The daemon and the job continue running. |
M_INFO |
Reports an informational message. |
There are other error message classes, but they are in a state of being redesigned or deprecated, so please do not use them. Some actual examples are:
Emsg1(M_ABORT, 0, "Cannot create message thread: \%s\n",strerror(status));
Emsg3(M_WARNING, 0, "Connect to File daemon %s at %s:%d failed. Retrying...\n",
client->hdr.name, client->address,client->port);
Emsg3(M_FATAL, 0, "bdird<filed: bad response from Filed to %s command:
%d %s\n", cmd, n, strerror(errno));
Possible Next Steps
Go back to Message Classes.
Go back to Developer Notes.
Go back to Developer Guide.