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