1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>DbEnv::err()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" /> 10 <link rel="up" href="env.html" title="Chapter��5.�� The DbEnv Handle" /> 11 <link rel="prev" href="envdbrename.html" title="DbEnv::dbrename()" /> 12 <link rel="next" href="envfailchk.html" title="DbEnv::failchk()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbEnv::err()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="envdbrename.html">Prev</a>��</td> 22 <th width="60%" align="center">Chapter��5.�� 23 The DbEnv Handle 24 </th> 25 <td width="20%" align="right">��<a accesskey="n" href="envfailchk.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="enverr"></a>DbEnv::err()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40DbEnv::err(int error, const char *fmt, ...); 41 42DbEnv::errx(const char *fmt, ...); </pre> 43 <p> 44 The <code class="methodname">DbEnv::err()</code>, <code class="methodname">DbEnv::errx,()</code>, 45 <a class="xref" href="dberr.html" title="Db::err()">Db::err()</a> and 46 <code class="methodname">Db::errx()</code> methods provide 47 error-messaging functionality for applications written using the 48 Berkeley DB library. 49 </p> 50 <p> 51 The <a class="xref" href="dberr.html" title="Db::err()">Db::err()</a> and 52 <a class="xref" href="enverr.html" title="DbEnv::err()">DbEnv::err()</a> 53 methods constructs an error message consisting of the 54 following elements: 55 </p> 56 <div class="itemizedlist"> 57 <ul type="disc"> 58 <li> 59 <p> 60 <span class="bold"><strong>An optional prefix string</strong></span> 61 </p> 62 <p> 63 If no error callback function has been set using the 64 <a class="xref" href="envset_errcall.html" title="DbEnv::set_errcall()">DbEnv::set_errcall()</a> 65 method, any prefix string specified using the 66 <a class="xref" href="envset_errpfx.html" title="DbEnv::set_errpfx()">DbEnv::set_errpfx()</a> 67 method, followed by two separating characters: a colon and a 68 <space> character. 69 </p> 70 </li> 71 <li> 72 <p> 73 <span class="bold"><strong>An optional printf-style message</strong></span> 74 </p> 75 <p> 76 The supplied message <span class="bold"><strong>fmt</strong></span>, if 77 non-NULL, in which the ANSI C X3.159-1989 (ANSI C) printf function 78 specifies how subsequent parameters are converted for output. 79 </p> 80 </li> 81 <li> 82 <p> 83 <span class="bold"><strong>A separator</strong></span> 84 </p> 85 <p> 86 Two separating characters: a colon and a <space> character. 87 </p> 88 </li> 89 <li> 90 <p> 91 <span class="bold"><strong>A standard error string</strong></span> 92 </p> 93 <p> 94 The standard system or Berkeley DB library error string associated 95 with the <span class="bold"><strong>error</strong></span> value, as returned by 96 the <a class="xref" href="envstrerror.html" title="DbEnv::strerror()">DbEnv::strerror()</a> 97 method. 98 </p> 99 </li> 100 </ul> 101 </div> 102 <p> 103 This constructed error message is then handled as follows: 104 </p> 105 <div class="itemizedlist"> 106 <ul type="disc"> 107 <li> 108 <p> 109 If an error callback function has been set (see 110 <a class="xref" href="dbset_errcall.html" title="Db::set_errcall()">Db::set_errcall()</a> and 111 <a class="xref" href="envset_errcall.html" title="DbEnv::set_errcall()">DbEnv::set_errcall()</a>), 112 that function is called with two parameters: any prefix string 113 specified (see <a class="xref" href="dbset_errpfx.html" title="Db::set_errpfx()">Db::set_errpfx()</a> 114 and <a class="xref" href="envset_errpfx.html" title="DbEnv::set_errpfx()">DbEnv::set_errpfx()</a>) and 115 the error message. 116 </p> 117 </li> 118 <li> 119 <p> 120 If a C library FILE * has been set (see 121 <a class="xref" href="dbset_errfile.html" title="Db::set_errfile()">Db::set_errfile()</a> and 122 <a class="xref" href="envset_errfile.html" title="DbEnv::set_errfile()">DbEnv::set_errfile()</a>), 123 the error message is written to that output stream. 124 </p> 125 </li> 126 <li> 127 <p> 128 If a C++ ostream has been set (see 129 <a class="xref" href="envset_error_stream.html" title="DbEnv::set_error_stream()">DbEnv::set_error_stream()</a> 130 and 131 <a class="xref" href="dbset_error_stream.html" title="Db::set_error_stream()">Db::set_error_stream()</a>), 132 the error message is written to that stream. 133 </p> 134 </li> 135 <li> 136 <p> 137 If none of these output options have been configured, the error message 138 is written to stderr, the standard error output stream. 139 </p> 140 </li> 141 </ul> 142 </div> 143 <div class="sect2" lang="en" xml:lang="en"> 144 <div class="titlepage"> 145 <div> 146 <div> 147 <h3 class="title"><a id="id1664359"></a>Parameters</h3> 148 </div> 149 </div> 150 </div> 151 <div class="sect3" lang="en" xml:lang="en"> 152 <div class="titlepage"> 153 <div> 154 <div> 155 <h4 class="title"><a id="id1664392"></a>error</h4> 156 </div> 157 </div> 158 </div> 159 <p> 160 The <span class="bold"><strong>error</strong></span> parameter is the error 161 value for which the <code class="methodname">DbEnv::err()</code> and 162 <a class="xref" href="dberr.html" title="Db::err()">Db::err()</a> methods will display a 163 explanatory string. 164 </p> 165 </div> 166 <div class="sect3" lang="en" xml:lang="en"> 167 <div class="titlepage"> 168 <div> 169 <div> 170 <h4 class="title"><a id="id1663947"></a>fmt</h4> 171 </div> 172 </div> 173 </div> 174 <p> 175 The <span class="bold"><strong>fmt</strong></span> parameter is an optional 176 printf-style message to display. 177 </p> 178 </div> 179 </div> 180 <div class="sect2" lang="en" xml:lang="en"> 181 <div class="titlepage"> 182 <div> 183 <div> 184 <h3 class="title"><a id="id1664558"></a>Class</h3> 185 </div> 186 </div> 187 </div> 188 <p> 189 <a class="link" href="env.html" title="Chapter��5.�� The DbEnv Handle">DbEnv</a> 190 </p> 191 </div> 192 <div class="sect2" lang="en" xml:lang="en"> 193 <div class="titlepage"> 194 <div> 195 <div> 196 <h3 class="title"><a id="id1664226"></a>See Also</h3> 197 </div> 198 </div> 199 </div> 200 <p> 201 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a> 202 </p> 203 </div> 204 </div> 205 <div class="navfooter"> 206 <hr /> 207 <table width="100%" summary="Navigation footer"> 208 <tr> 209 <td width="40%" align="left"><a accesskey="p" href="envdbrename.html">Prev</a>��</td> 210 <td width="20%" align="center"> 211 <a accesskey="u" href="env.html">Up</a> 212 </td> 213 <td width="40%" align="right">��<a accesskey="n" href="envfailchk.html">Next</a></td> 214 </tr> 215 <tr> 216 <td width="40%" align="left" valign="top">DbEnv::dbrename()��</td> 217 <td width="20%" align="center"> 218 <a accesskey="h" href="index.html">Home</a> 219 </td> 220 <td width="40%" align="right" valign="top">��DbEnv::failchk()</td> 221 </tr> 222 </table> 223 </div> 224 </body> 225</html> 226