File: errors.html

package info (click to toggle)
evolution-data-server 1.0.4-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 39,504 kB
  • ctags: 26,423
  • sloc: ansic: 175,347; tcl: 30,499; sh: 20,699; perl: 11,320; xml: 9,039; java: 7,653; cpp: 6,029; makefile: 4,866; awk: 1,338; yacc: 1,103; sed: 772; cs: 505; lex: 134; asm: 14
file content (47 lines) | stat: -rw-r--r-- 3,175 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!--$Id: errors.html,v 1.1.1.1 2003/11/20 22:14:20 toshok Exp $-->
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
<!--All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: Error returns</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
</head>
<body bgcolor=white>
<table width="100%"><tr valign=top>
<td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Simple Tutorial</dl></h3></td>
<td align=right><a href="../../ref/simple_tut/handles.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/simple_tut/open.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p>
<h1 align=center>Error returns</h1>
<p>The Berkeley DB interfaces always return a value of 0 on success.  If the
operation does not succeed for any reason, the return value will be
non-zero.
<p>If a system error occurred (for example, Berkeley DB ran out of disk space,
or permission to access a file was denied, or an illegal argument was
specified to one of the interfaces), Berkeley DB returns an <b>errno</b>
value.  All of the possible values of <b>errno</b> are greater than
0.
<p>If the operation didn't fail due to a system error, but wasn't
successful either, Berkeley DB returns a special error value.  For example,
if you tried to retrieve the data item associated with the key
<b>fruit</b>, and there was no such key/data pair in the database,
Berkeley DB would return <a href="../../ref/program/errorret.html#DB_NOTFOUND">DB_NOTFOUND</a>, a special error value that means
the requested key does not appear in the database.  All of the possible
special error values are less than 0.
<p>Berkeley DB also offers programmatic support for displaying error return values.
First, the <a href="../../api_c/env_strerror.html">db_strerror</a> interface returns a pointer to the error
message corresponding to any Berkeley DB error return, similar to the ANSI C
strerror interface, but is able to handle both system error returns and
Berkeley DB-specific return values.
<p>Second, there are two error functions, <a href="../../api_c/db_err.html">DB-&gt;err</a> and <a href="../../api_c/db_err.html">DB-&gt;errx</a>.
These functions work like the ANSI C printf interface, taking a
printf-style format string and argument list, and optionally appending
the standard error string to a message constructed from the format string
and other arguments.
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/simple_tut/handles.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/simple_tut/open.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
</body>
</html>