2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB Reference Guide: Run-time error information</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
<table width="100%"><tr valign=top>
13
<td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Debugging Applications</dl></h3></td>
14
<td align=right><a href="../../ref/debug/compile.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/debug/printlog.html"><img src="../../images/next.gif" alt="Next"></a>
17
<h1 align=center>Run-time error information</h1>
18
<p>Normally, when an error occurs in the Berkeley DB library, an integer value
19
(either a Berkeley DB specific value or a system <b>errno</b> value) is
20
returned by the Berkeley DB interface. In some cases, however, this value
21
may be insufficient to completely describe the cause of the error,
22
especially during initial application debugging.
23
<p>There are four interfaces intended to provide applications with
24
additional run-time error information:
25
<a href="../../api_c/env_set_errcall.html">DB_ENV->set_errcall</a>, <a href="../../api_c/env_set_errfile.html">DB_ENV->set_errfile</a>,
26
<a href="../../api_c/env_set_errpfx.html">DB_ENV->set_errpfx</a>, and <a href="../../api_c/env_set_verbose.html">DB_ENV->set_verbose</a>.
27
<p>If the environment is configured with these interfaces, many Berkeley DB errors
28
will result in additional information being written to a file or passed
29
as an argument to an application function.
30
<p>The Berkeley DB error-reporting facilities do not slow performance or
31
significantly increase application size, and may be run during normal
32
operation as well as during debugging. Where possible, we recommend
33
that these options always be configured and the output saved in the
34
filesystem. We have found that this often saves time when debugging
35
installation or other system-integration problems.
36
<p>In addition, there are three interfaces to assist applications in
37
displaying their own error messages: <a href="../../api_c/env_strerror.html">db_strerror</a>,
38
<a href="../../api_c/env_err.html">DB_ENV->err</a>, and <a href="../../api_c/env_err.html">DB_ENV->errx</a>. The first is a superset of
39
the ANSI C strerror interface, and returns a descriptive string for any
40
error return from the Berkeley DB library. The <a href="../../api_c/env_err.html">DB_ENV->err</a> and
41
<a href="../../api_c/env_err.html">DB_ENV->errx</a> methods use the error message configuration options
42
described previously to format and display error messages to appropriate
44
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/debug/compile.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/debug/printlog.html"><img src="../../images/next.gif" alt="Next"></a>
46
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>