1<!--$Id: db_err.so,v 1.3 2002/08/18 21:15:48 bostic Exp $-->
2<!--$Id: env_err.so,v 10.34 2006/04/27 20:17:47 bostic Exp $-->
3<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
4<!--See the file LICENSE for redistribution information.-->
5<html>
6<head>
7<title>Berkeley DB: DB-&gt;err</title>
8<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
10</head>
11<body bgcolor=white>
12<table width="100%"><tr valign=top>
13<td>
14<b>DB-&gt;err</b>
15</td>
16<td align=right>
17<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a>
18<a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a></td>
19</tr></table>
20<hr size=1 noshade>
21<tt>
22<b><pre>
23#include &lt;db.h&gt;
24<p>
25void
26DB-&gt;err(DB *db, int error, const char *fmt, ...);
27<p>
28void
29DB-&gt;errx(DB *db, const char *fmt, ...);
30</pre></b>
31<hr size=1 noshade>
32<b>Description: DB-&gt;err</b>
33<p>The <a href="/api_c/env_err.html">DB_ENV-&gt;err</a>, <a href="/api_c/env_err.html">DB_ENV-&gt;errx</a>,  DB-&gt;err and
34DB-&gt;errx methods provide error-messaging functionality for
35applications written using the Berkeley DB library.</p>
36<p>The DB-&gt;err and <a href="/api_c/env_err.html">DB_ENV-&gt;err</a> methods constructs an error message
37consisting of the following elements:</p>
38<blockquote><br>
39<b>An optional prefix string</b><ul compact><li>If no error callback function has been set using the
40<a href="/api_c/env_set_errcall.html">DB_ENV-&gt;set_errcall</a> method, any prefix string specified using the
41<a href="/api_c/env_set_errpfx.html">DB_ENV-&gt;set_errpfx</a> method, followed by two separating characters: a colon
42and a &lt;space&gt; character.</ul>
43<b>An optional printf-style message</b><ul compact><li>The supplied message <b>fmt</b>, if non-NULL, in which the
44ANSI C X3.159-1989 (ANSI C) printf function specifies how subsequent parameters
45are converted for output.</ul>
46<b>A separator</b><ul compact><li>Two separating characters: a colon and a &lt;space&gt; character.</ul>
47<b>A standard error string</b><ul compact><li>The standard system or Berkeley DB library error string associated with the
48<b>error</b> value, as returned by the <a href="/api_c/env_strerror.html">db_strerror</a> method.</ul>
49<br>
50</blockquote>
51<p>The DB-&gt;errx and <a href="/api_c/env_err.html">DB_ENV-&gt;errx</a> methods are the same as the
52DB-&gt;err and <a href="/api_c/env_err.html">DB_ENV-&gt;err</a> methods, except they do not append the
53final separator characters and standard error string to the error
54message.</p>
55<p>This constructed error message is then handled as follows:</p>
56<blockquote><p>If an error callback function has been set (see <a href="/api_c/db_set_errcall.html">DB-&gt;set_errcall</a>
57and <a href="/api_c/env_set_errcall.html">DB_ENV-&gt;set_errcall</a>), that function is called with two
58parameters: any prefix string specified (see <a href="/api_c/db_set_errpfx.html">DB-&gt;set_errpfx</a> and
59<a href="/api_c/env_set_errpfx.html">DB_ENV-&gt;set_errpfx</a>) and the error message.</p>
60<p>If a C library FILE * has been set (see <a href="/api_c/db_set_errfile.html">DB-&gt;set_errfile</a> and
61<a href="/api_c/env_set_errfile.html">DB_ENV-&gt;set_errfile</a>), the error message is written to that output
62stream.</p>
63<p>If none of these output options has been configured, the error message
64is written to stderr, the standard error output stream.</p></blockquote>
65<b>Parameters</b> <br>
66 <b>error</b><ul compact><li>The <b>error</b> parameter is the error value for which the
67<a href="/api_c/env_err.html">DB_ENV-&gt;err</a>  and  DB-&gt;err methods will display a explanatory
68string.</ul>
69 <b>fmt</b><ul compact><li>The <b>fmt</b> parameter is an optional printf-style message to display.</ul>
70<br>
71<hr size=1 noshade>
72<br><b>Class</b>
73<a href="/api_c/db_class.html">DB</a>
74<br><b>See Also</b>
75<a href="/api_c/db_list.html">Databases and Related Methods</a>
76</tt>
77<table width="100%"><tr><td><br></td><td align=right>
78<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a>
79</td></tr></table>
80<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
81</body>
82</html>
83