1<!--$Id: runtime.so,v 10.21 2007/07/10 17:37:22 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB Reference Guide: Run-time error information</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Debugging Applications</dl></b></td> 13<td align=right><a href="../debug/compile.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../debug/printlog.html"><img src="../../images/next.gif" alt="Next"></a> 14</td></tr></table> 15<p align=center><b>Run-time error information</b></p> 16<p>Normally, when an error occurs in the Berkeley DB library, an integer value 17(either a Berkeley DB specific value or a system <b>errno</b> value) is 18returned by Berkeley DB. In some cases, however, this value may be 19insufficient to completely describe the cause of the error, especially 20during initial application debugging.</p> 21<p>Most Berkeley DB errors will result in additional information being written 22to a standard file descriptor or output stream. Additionally, Berkeley DB can 23be configured to pass these verbose error messages to an application 24function. There are four methods intended to provide applications with 25additional error information: 26<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>, 27<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>.</p> 28<p>The Berkeley DB error-reporting facilities do not slow performance or 29significantly increase application size, and may be run during normal 30operation as well as during debugging. Where possible, we recommend 31these options always be configured and the output saved in the 32filesystem. We have found that this often saves time when debugging 33installation or other system-integration problems.</p> 34<p>In addition, there are three methods to assist applications in 35displaying their own error messages: <a href="../../api_c/env_strerror.html">db_strerror</a>, 36<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 37the ANSI C strerror function, and returns a descriptive string for any 38error return from the Berkeley DB library. The <a href="../../api_c/env_err.html">DB_ENV->err</a> and 39<a href="../../api_c/env_err.html">DB_ENV->errx</a> methods use the error message configuration options 40described previously to format and display error messages to appropriate 41output devices.</p> 42<table width="100%"><tr><td><br></td><td align=right><a href="../debug/compile.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../debug/printlog.html"><img src="../../images/next.gif" alt="Next"></a> 43</td></tr></table> 44<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 45</body> 46</html> 47