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>DB_ENV->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 DB_ENV Handle" /> 11 <link rel="prev" href="envdbrename.html" title="DB_ENV->dbrename()" /> 12 <link rel="next" href="envfailchk.html" title="DB_ENV->failchk()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DB_ENV->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 DB_ENV 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>DB_ENV->err()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40void 41DB_ENV->err(DB_ENV *dbenv, int error, const char *fmt, ...); 42 43void 44DB_ENV->errx(DB_ENV *dbenv, const char *fmt, ...); </pre> 45 <p> 46 The <code class="methodname">DB_ENV->err()</code>, <code class="methodname">DB_ENV->errx,()</code>, 47 <a class="xref" href="dberr.html" title="DB->err()">DB->err()</a> and 48 <code class="methodname">DB->errx()</code> methods provide 49 error-messaging functionality for applications written using the 50 Berkeley DB library. 51 </p> 52 <p> 53 The <a class="xref" href="dberr.html" title="DB->err()">DB->err()</a> and 54 <a class="xref" href="enverr.html" title="DB_ENV->err()">DB_ENV->err()</a> 55 methods constructs an error message consisting of the 56 following elements: 57 </p> 58 <div class="itemizedlist"> 59 <ul type="disc"> 60 <li> 61 <p> 62 <span class="bold"><strong>An optional prefix string</strong></span> 63 </p> 64 <p> 65 If no error callback function has been set using the 66 <a class="xref" href="envset_errcall.html" title="DB_ENV->set_errcall()">DB_ENV->set_errcall()</a> 67 method, any prefix string specified using the 68 <a class="xref" href="envset_errpfx.html" title="DB_ENV->set_errpfx()">DB_ENV->set_errpfx()</a> 69 method, followed by two separating characters: a colon and a 70 <space> character. 71 </p> 72 </li> 73 <li> 74 <p> 75 <span class="bold"><strong>An optional printf-style message</strong></span> 76 </p> 77 <p> 78 The supplied message <span class="bold"><strong>fmt</strong></span>, if 79 non-NULL, in which the ANSI C X3.159-1989 (ANSI C) printf function 80 specifies how subsequent parameters are converted for output. 81 </p> 82 </li> 83 <li> 84 <p> 85 <span class="bold"><strong>A separator</strong></span> 86 </p> 87 <p> 88 Two separating characters: a colon and a <space> character. 89 </p> 90 </li> 91 <li> 92 <p> 93 <span class="bold"><strong>A standard error string</strong></span> 94 </p> 95 <p> 96 The standard system or Berkeley DB library error string associated 97 with the <span class="bold"><strong>error</strong></span> value, as returned by 98 the <a class="xref" href="envstrerror.html" title="db_strerror">db_strerror</a> 99 method. 100 </p> 101 </li> 102 </ul> 103 </div> 104 <p> 105 This constructed error message is then handled as follows: 106 </p> 107 <div class="itemizedlist"> 108 <ul type="disc"> 109 <li> 110 <p> 111 If an error callback function has been set (see 112 <a class="xref" href="dbset_errcall.html" title="DB->set_errcall()">DB->set_errcall()</a> and 113 <a class="xref" href="envset_errcall.html" title="DB_ENV->set_errcall()">DB_ENV->set_errcall()</a>), 114 that function is called with two parameters: any prefix string 115 specified (see <a class="xref" href="dbset_errpfx.html" title="DB->set_errpfx()">DB->set_errpfx()</a> 116 and <a class="xref" href="envset_errpfx.html" title="DB_ENV->set_errpfx()">DB_ENV->set_errpfx()</a>) and 117 the error message. 118 </p> 119 </li> 120 <li> 121 <p> 122 If a C library FILE * has been set (see 123 <a class="xref" href="dbset_errfile.html" title="DB->set_errfile()">DB->set_errfile()</a> and 124 <a class="xref" href="envset_errfile.html" title="DB_ENV->set_errfile()">DB_ENV->set_errfile()</a>), 125 the error message is written to that output stream. 126 </p> 127 </li> 128 <li> 129 <p> 130 If none of these output options have been configured, the error message 131 is written to stderr, the standard error output stream. 132 </p> 133 </li> 134 </ul> 135 </div> 136 <div class="sect2" lang="en" xml:lang="en"> 137 <div class="titlepage"> 138 <div> 139 <div> 140 <h3 class="title"><a id="id1662152"></a>Parameters</h3> 141 </div> 142 </div> 143 </div> 144 <div class="sect3" lang="en" xml:lang="en"> 145 <div class="titlepage"> 146 <div> 147 <div> 148 <h4 class="title"><a id="id1662191"></a>error</h4> 149 </div> 150 </div> 151 </div> 152 <p> 153 The <span class="bold"><strong>error</strong></span> parameter is the error 154 value for which the <code class="methodname">DB_ENV->err()</code> and 155 <a class="xref" href="dberr.html" title="DB->err()">DB->err()</a> methods will display a 156 explanatory string. 157 </p> 158 </div> 159 <div class="sect3" lang="en" xml:lang="en"> 160 <div class="titlepage"> 161 <div> 162 <div> 163 <h4 class="title"><a id="id1662192"></a>fmt</h4> 164 </div> 165 </div> 166 </div> 167 <p> 168 The <span class="bold"><strong>fmt</strong></span> parameter is an optional 169 printf-style message to display. 170 </p> 171 </div> 172 </div> 173 <div class="sect2" lang="en" xml:lang="en"> 174 <div class="titlepage"> 175 <div> 176 <div> 177 <h3 class="title"><a id="id1662007"></a>Class</h3> 178 </div> 179 </div> 180 </div> 181 <p> 182 <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a> 183 </p> 184 </div> 185 <div class="sect2" lang="en" xml:lang="en"> 186 <div class="titlepage"> 187 <div> 188 <div> 189 <h3 class="title"><a id="id1662005"></a>See Also</h3> 190 </div> 191 </div> 192 </div> 193 <p> 194 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a> 195 </p> 196 </div> 197 </div> 198 <div class="navfooter"> 199 <hr /> 200 <table width="100%" summary="Navigation footer"> 201 <tr> 202 <td width="40%" align="left"><a accesskey="p" href="envdbrename.html">Prev</a> </td> 203 <td width="20%" align="center"> 204 <a accesskey="u" href="env.html">Up</a> 205 </td> 206 <td width="40%" align="right"> <a accesskey="n" href="envfailchk.html">Next</a></td> 207 </tr> 208 <tr> 209 <td width="40%" align="left" valign="top">DB_ENV->dbrename() </td> 210 <td width="20%" align="center"> 211 <a accesskey="h" href="index.html">Home</a> 212 </td> 213 <td width="40%" align="right" valign="top"> DB_ENV->failchk()</td> 214 </tr> 215 </table> 216 </div> 217 </body> 218</html> 219