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