# DBENV->err |

`

###

    #include <db.h>

    void
    DBENV->err(DB_ENV *dbenv, int error, const char *fmt, ...);

    void
    DBENV->errx(DB_ENV *dbenv, const char *fmt, ...);

    void
    DB->err(DB *db, int error, const char *fmt, ...);

    void
    DB->errx(DB *db, const char *fmt, ...);

# Description

The DBENV->err, DBENV->errx, DB->err and DB->errx functions provide error messaging functionality for applications written using the Berkeley DB library.

The DBENV->err function constructs an error message consisting of the following elements:

> An optional prefix string
>   If no error callback function has been set using the DBENV->set_errcall function, any prefix string specified using the DBENV->set_errpfx function, followed by two separating characters: a colon and a <space> character.

> An optional printf-style message
>   The supplied message fmt, if non-NULL, where the ANSI C X3.159-1989 (ANSI C) printf function specifies how subsequent arguments are converted for output.

> A separator
>   Two separating characters: a colon and a <space> character.

> A standard error string
>   The standard system or Berkeley DB library error string associated with the error value, as returned by the db_strerror function.

This constructed error message is then handled as follows:

> If an error callback function has been set (see DB->set_errcall and DBENV->set_errcall), that function is called with two arguments: any prefix string specified (see DB->set_errpfx and DBENV->set_errpfx), and the error message.

> If a C library FILE * has been set (see DB->set_errfile and DBENV->set_errfile), the error message is written to that output stream.

> If none of these output options has been configured, the error message is written to stderr, the standard error output stream.

The DBENV->errx and DB->errx functions perform identically to the DBENV->err and DB->err functions except that they do not append the final separator characters and standard error string to the error message.

# See Also

DBENV->close, db_env_create, DBENV->open, DBENV->remove, DBENV->err, db_strerror, db_version, DBENV->set_cachesize, DBENV->set_errcall, DBENV->set_errfile, DBENV->set_errpfx, DBENV->set_paniccall, and DBENV->set_verbose.`

Copyright Sleepycat Software