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::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::err</b> 15</td> 16<td align=right> 17<a href="/api_cxx/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 <db_cxx.h> 24<p> 25Db::err(int error, const char *fmt, ...); 26<p> 27Db::errx(const char *fmt, ...); 28</pre></b> 29<hr size=1 noshade> 30<b>Description: Db::err</b> 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 32Db::errx methods provide error-messaging functionality for 33applications written using the Berkeley DB library.</p> 34<p>The Db::err and <a href="/api_cxx/env_err.html">DbEnv::err</a> methods constructs an error message 35consisting of the following elements:</p> 36<blockquote><br> 37<b>An optional prefix string</b><ul compact><li>If no error callback function 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 40and a <space> character.</ul> 41<b>An optional printf-style message</b><ul compact><li>The supplied message <b>fmt</b>, if non-NULL, in which the 42ANSI C X3.159-1989 (ANSI C) printf function specifies how subsequent parameters 43are converted for output.</ul> 44<b>A separator</b><ul compact><li>Two separating characters: a colon and a <space> character.</ul> 45<b>A standard error string</b><ul compact><li>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.</ul> 47<br> 48</blockquote> 49<p>The Db::errx and <a href="/api_cxx/env_err.html">DbEnv::errx</a> methods are the same as the 50Db::err and <a href="/api_cxx/env_err.html">DbEnv::err</a> methods, except they do not append the 51final separator characters and standard error string to the error 52message.</p> 53<p>This constructed error message is then handled as follows:</p> 54<blockquote><p>If an error callback function has been set (see <a href="/api_cxx/db_set_errcall.html">Db::set_errcall</a> 55and <a href="/api_cxx/env_set_errcall.html">DbEnv::set_errcall</a>), that function is called with two 56parameters: any prefix string specified (see <a href="/api_cxx/db_set_errpfx.html">Db::set_errpfx</a> and 57<a href="/api_cxx/env_set_errpfx.html">DbEnv::set_errpfx</a>) and the error message.</p> 58<p>If a C library FILE * has been set (see <a href="/api_cxx/db_set_errfile.html">Db::set_errfile</a> and 59<a href="/api_cxx/env_set_errfile.html">DbEnv::set_errfile</a>), the error message is written to that output 60stream.</p> 61<p>If a C++ ostream has been set 62(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>), 63the error message is written to that stream.</p> 64<p>If none of these output options has been configured, the error message 65is written to stderr, the standard error output stream.</p></blockquote> 66<b>Parameters</b> <br> 67 <b>error</b><ul compact><li>The <b>error</b> parameter is the error value for which the 68<a href="/api_cxx/env_err.html">DbEnv::err</a> and Db::err methods will display a explanatory 69string.</ul> 70 <b>fmt</b><ul compact><li>The <b>fmt</b> parameter is an optional printf-style message to display.</ul> 71<br> 72<hr size=1 noshade> 73<br><b>Class</b> 74<a href="/api_cxx/db_class.html">Db</a> 75<br><b>See Also</b> 76<a href="/api_cxx/db_list.html">Databases and Related Methods</a> 77</tt> 78<table width="100%"><tr><td><br></td><td align=right> 79<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a> 80</td></tr></table> 81<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 82</body> 83</html> 84