# eXtremeDB Error Handling

> Part of the normal application development process involves including code to manage error conditions that can occur during program execution. To facilitate error handling the eXtremeDB runtime uses return codes to indicate the status of the runtime after execution of a function or method.

> The C API runtime functions return three categories of return codes:

> - Status codes that indicate a state of the database runtime. If not handled, these could lead to an error condition.
> - Error codes that indicate that the runtime failed to perform the requested operation. The application can handle the error and continue running.
> - Fatal error codes (exceptions); these indicate that any further use of the database runtime is not possible. A fatal exception is usually a sign of a bug in either the application code or (rarely) the database runtime code.

> These return codes require appropriate handling in the application. In the Java and C# APIs, class methods may return no value (void), a `long` value representing an object’s `autoid`, or a `boolean` value representing success or failure. For example in Java:

> > The Connection method `startTransaction()` returns no value

> > The Connection method `insert()` returns the `autoid` of the inserted object or null

> > The Cursor method `moveNext()` returns `true` if a next object exists, otherwise `false`

> However, whenever a fatal error occurs, an exception will be thrown indicating the source of the error.

> Please use the links below to view detailed explanations and examples for your development environment:

> C | Handling return codes and error conditions in C
> C++ | Handling return codes and error conditions in C++
> Java | Handling return codes and error conditions in Java
> Python | Handling return codes and error conditions in Python
> C# | Handling return codes and error conditions in C#