NAME

caterr_error - generate error message

SYNOPSIS

#include <cat/cat.h>

void caterr_error(cat_session *sess, const char *label, int major_code, int retval, const char *fmt, ...);

DESCRIPTION

This function generates a formatted error message.

label has the format module.format, where module can be a dot-separated list of submodules. This argument can be used when selecting the data to be output.

major_code is the severity of the error and retval is the code that the function raising the error intends to return to its caller. These codes are described in caterr.

The format string, fmt, and other arguments behave as described for sprintf().

This function will also invoke any callback installed by a previous call to caterr_setfunc().

EXAMPLE

  if ((n = cat_getfile(path, &data)) < 0) {
      caterr_error(NULL, "setup.initialize", CAT_WARNING, n,
                   "Could not open auxilliary data file");
  }

SEE ALSO

cat, caterr, caterr_setfunc