3
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
4
<!--All rights reserved.-->
5
<!--See the file LICENSE for redistribution information.-->
8
<title>Berkeley DB: Db::err</title>
9
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
10
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
13
<a name="2"><!--meow--></a>
14
<table width="100%"><tr valign=top>
19
<a href="../api_cxx/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
24
#include <db_cxx.h>
26
Db::err(int error, const char *fmt, ...);
28
Db::errx(const char *fmt, ...);
31
<p>The <a href="../api_cxx/env_err.html">DbEnv::err</a>, <a href="../api_cxx/env_err.html">DbEnv::errx</a>, Db::err and
32
Db::errx methods provide error-messaging functionality for
33
applications written using the Berkeley DB library.
34
<p>The <a href="../api_cxx/env_err.html">DbEnv::err</a> method constructs an error message consisting of the
36
<p><blockquote><p><dl compact>
37
<p><dt>An optional prefix string<dd>If no error callback method has been set using the
38
<a href="../api_cxx/env_set_errcall.html">DbEnv::set_errcall</a> method, any prefix string specified using the
39
<a href="../api_cxx/env_set_errpfx.html">DbEnv::set_errpfx</a> method, followed by two separating characters: a colon
40
and a <space> character.
41
<p><dt>An optional printf-style message<dd>The supplied message <b>fmt</b>, if non-NULL, in which the
42
ANSI C X3.159-1989 (ANSI C) printf function specifies how subsequent arguments
43
are converted for output.
44
<p><dt>A separator<dd>Two separating characters: a colon and a <space> character.
45
<p><dt>A standard error string<dd>The standard system or Berkeley DB library error string associated with the
46
<b>error</b> value, as returned by the <a href="../api_cxx/env_strerror.html">DbEnv::strerror</a> method.
49
<p>This constructed error message is then handled as follows:
51
<p>If an error callback method has been set (see <a href="../api_cxx/db_set_errcall.html">Db::set_errcall</a>
52
and <a href="../api_cxx/env_set_errcall.html">DbEnv::set_errcall</a>), that method is called with two
53
arguments: any prefix string specified (see <a href="../api_cxx/db_set_errpfx.html">Db::set_errpfx</a> and
54
<a href="../api_cxx/env_set_errpfx.html">DbEnv::set_errpfx</a>) and the error message.
55
<p>If a C library FILE * has been set (see <a href="../api_cxx/db_set_errfile.html">Db::set_errfile</a> and
56
<a href="../api_cxx/env_set_errfile.html">DbEnv::set_errfile</a>), the error message is written to that output
58
<p>If a C++ ostream has been set
59
(see <a href="../api_cxx/env_set_error_stream.html">DbEnv::set_error_stream</a> and <a href="../api_cxx/db_set_error_stream.html">Db::set_error_stream</a>),
60
the error message is written to that stream.
61
<p>If none of these output options has been configured, the error message
62
is written to stderr, the standard
63
error output stream.</blockquote>
64
<p>The <a href="../api_cxx/env_err.html">DbEnv::errx</a> and Db::errx methods perform identically to the
65
<a href="../api_cxx/env_err.html">DbEnv::err</a> and Db::err methods, except that they do not append
66
the final separator characters and standard error string to the error
69
<a href="../api_cxx/db_class.html">Db</a>
71
<a href="../api_cxx/db_list.html">Databases and Related Methods</a>
73
<table width="100%"><tr><td><br></td><td align=right>
74
<a href="../api_cxx/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
76
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>