DbEnv::err |
#include <db_cxx.h>DbEnv::err(int error, const char *fmt, ...);
DbEnv::errx(const char *fmt, ...);
The DbEnv::err, DbEnv::errx, Db::err and Db::errx methods provide error-messaging functionality for applications written using the Berkeley DB library.
The Db::err and DbEnv::err methods constructs an error message consisting of the following elements:
An optional prefix stringAn optional printf-style message
- If no error callback function has been set using the DbEnv::set_errcall method, any prefix string specified using the DbEnv::set_errpfx method, followed by two separating characters: a colon and a <space> character.
A separator
- The supplied message fmt, if non-NULL, in which the ANSI C X3.159-1989 (ANSI C) printf function specifies how subsequent parameters are converted for output.
A standard error string
- Two separating characters: a colon and a <space> character.
- The standard system or Berkeley DB library error string associated with the error value, as returned by the DbEnv::strerror method.
The Db::errx and DbEnv::errx methods are the same as the Db::err and DbEnv::err methods, except they do not append the final separator characters and standard error string to the error message.
This constructed error message is then handled as follows:
ParametersIf an error callback function has been set (see Db::set_errcall and DbEnv::set_errcall), that function is called with two parameters: 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 a C++ ostream has been set (see DbEnv::set_error_stream and Db::set_error_stream), the error message is written to that stream.
If none of these output options has been configured, the error message is written to stderr, the standard error output stream.
Copyright (c) 1996,2008 Oracle. All rights reserved.