diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-02-17 17:25:57 +0000 |
|---|---|---|
| committer | <> | 2015-03-17 16:26:24 +0000 |
| commit | 780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch) | |
| tree | 598f8b9fa431b228d29897e798de4ac0c1d3d970 /docs/programmer_reference/am_misc_error.html | |
| parent | 7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff) | |
| download | berkeleydb-master.tar.gz | |
Diffstat (limited to 'docs/programmer_reference/am_misc_error.html')
| -rw-r--r-- | docs/programmer_reference/am_misc_error.html | 66 |
1 files changed, 43 insertions, 23 deletions
diff --git a/docs/programmer_reference/am_misc_error.html b/docs/programmer_reference/am_misc_error.html index 1739d9a0..df4e5149 100644 --- a/docs/programmer_reference/am_misc_error.html +++ b/docs/programmer_reference/am_misc_error.html @@ -14,7 +14,7 @@ <body> <div xmlns="" class="navheader"> <div class="libver"> - <p>Library Version 11.2.5.3</p> + <p>Library Version 12.1.6.1</p> </div> <table width="100%" summary="Navigation header"> <tr> @@ -22,9 +22,7 @@ </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="am_misc_perm.html">Prev</a> </td> - <th width="60%" align="center">Chapter 4. - Access Method Wrapup - </th> + <th width="60%" align="center">Chapter 4. Access Method Wrapup </th> <td width="20%" align="right"> <a accesskey="n" href="am_misc_stability.html">Next</a></td> </tr> </table> @@ -38,12 +36,20 @@ </div> </div> </div> - <p>Berkeley DB offers programmatic support for displaying error return values.</p> - <p>The <a href="../api_reference/C/envstrerror.html" class="olink">db_strerror()</a> function returns a pointer to the error -message corresponding to any Berkeley DB error return, similar to the ANSI C -strerror function, but is able to handle both system error returns and -Berkeley DB specific return values.</p> - <p>For example:</p> + <p> + Berkeley DB offers programmatic support for displaying error + return values. + </p> + <p> + The <a href="../api_reference/C/envstrerror.html" class="olink">db_strerror()</a> function returns a pointer to the error + message corresponding to any Berkeley DB error return, similar + to the ANSI C strerror function, but is able to handle both + system error returns and Berkeley DB specific return + values. + </p> + <p> + For example: + </p> <a id="prog_am25"></a> <pre class="programlisting">int ret; ... @@ -51,17 +57,28 @@ if ((ret = dbp->put(dbp, NULL, &key, &data, 0)) != 0) { fprintf(stderr, "put failed: %s\n", db_strerror(ret)); return (1); }</pre> - <p>There are also two additional error methods, <a href="../api_reference/C/dberr.html" class="olink">DB->err()</a> and -<code class="methodname">DB->errx()</code>. These methods work like the ANSI C X3.159-1989 (ANSI C) printf -function, taking a printf-style format string and argument list, and -writing a message constructed from the format string and arguments.</p> - <p>The <a href="../api_reference/C/dberr.html" class="olink">DB->err()</a> method appends the standard error string to the -constructed message; the <code class="methodname">DB->errx()</code> method does not. These methods -provide simpler ways of displaying Berkeley DB error messages. For example, -if your application tracks session IDs in a variable called session_id, -it can include that information in its error messages:</p> - <p>Error messages can additionally be configured to always include a prefix -(for example, the program name) using the <a href="../api_reference/C/dbset_errpfx.html" class="olink">DB->set_errpfx()</a> method.</p> + <p> + There are also two additional error methods, <a href="../api_reference/C/dberr.html" class="olink">DB->err()</a> and + <code class="methodname">DB->errx()</code>. These methods work + like the ANSI C X3.159-1989 (ANSI C) printf function, taking a + printf-style format string and argument list, and writing a + message constructed from the format string and + arguments. + </p> + <p> + The <a href="../api_reference/C/dberr.html" class="olink">DB->err()</a> method appends the standard error string to the + constructed message; the + <code class="methodname">DB->errx()</code> method does not. + These methods provide simpler ways of displaying Berkeley DB + error messages. For example, if your application tracks + session IDs in a variable called session_id, it can include + that information in its error messages: + </p> + <p> + Error messages can additionally be configured to always + include a prefix (for example, the program name) using the + <a href="../api_reference/C/dbset_errpfx.html" class="olink">DB->set_errpfx()</a> method. + </p> <a id="prog_am26"></a> <pre class="programlisting">#define DATABASE "access.db" @@ -77,8 +94,11 @@ if ((ret = dbp->open(dbp, session_id); return (1); }</pre> - <p>For example, if the program were called my_app and the open call returned -an EACCESS system error, the error messages shown would appear as follows:</p> + <p> + For example, if the program were called my_app and the open + call returned an EACCESS system error, the error messages + shown would appear as follows: + </p> <pre class="programlisting">my_app: access.db: Permission denied. my_app: contact your system administrator: session ID was 14</pre> </div> |
