The Job status code is good, but users have to dig into the
log output to determine the reason of the failure.
We can keep the first FATAL message code inside jcr->StatusInfo
and store it in the catalog to help users. ([DE0001] kind of code)
char *job_user; /* Specific permission for a job */
char *job_group; /* Specific permission for a job */
POOLMEM *StatusErrMsg; /* Error message displayed in the job report */
+ char StatusInfo[MAX_NAME_LENGTH]; /* Additionnal information about the error status */
uint32_t getErrors() { return JobErrors + SDErrors; }; /* Get error count */
/* Daemon specific part of JCR */
dispatch_message(jcr, type, mtime, rbuf);
+ if (type == M_FATAL && jcr && jcr->StatusInfo[0] == 0) {
+ char d, t;
+ int code;
+ if (scan_string(rbuf+len, "[%c%c%d] ", &d, &t, &code) == 3) {
+ bsnprintf(jcr->StatusInfo, sizeof(jcr->StatusInfo), "[%c%c%04d]", d, t, code);
+ }
+ }
+
if (type == M_ABORT){
char *p = 0;
printf("Bacula forced SEG FAULT to obtain traceback.\n");