The C# DatabaseError Class

DatabaseError is the exception type thrown by the eXtremeDB C# wrapper for runtime, storage, HA, TL, SQL, and other database errors. It exposes both the numeric error code and the typed MCO_RET_E status value, and it may also carry extended diagnostic information through ErrorInfo.

For an overview see page C# Classes

Class Definition

    [Serializable]
    public class DatabaseError : Exception
    {
        public readonly int errorCode;
        public readonly ErrorInfo errorInfo;

        public DatabaseError(int err, string description);
        public DatabaseError(int err, string description, ErrorInfo ei);

        public MCO_RET_E Status { get; }
        public override string Message { get; }
    }

 

Member Descriptions

DatabaseError class
Managed exception type used by the C# wrapper to report eXtremeDB failures.
errorCode
Contains the raw integer eXtremeDB return code.
errorInfo
Contains extended diagnostic information when such information is available from the underlying runtime layer. This field can be null.
DatabaseError(int err, string description)
Creates an exception with the specified numeric error code and textual description.
DatabaseError(int err, string description, ErrorInfo ei)
Creates an exception with the specified numeric error code, textual description, and extended error information.
Status
Returns the strongly typed MCO_RET_E value corresponding to errorCode.
Message
Returns the formatted exception message. The wrapper includes both the integer code and the symbolic MCO_RET_E name in the message text.
Typical Usage
Catch DatabaseError when an API call can fail due to runtime conditions, then inspect errorCode, Status, and optional errorInfo to decide whether the error is expected, retryable, or fatal.
Error Code Interpretation
Use Status when application code benefits from symbolic checks such as MCO_RET_E.MCO_E_CONFLICT or MCO_RET_E.MCO_S_NOTFOUND. Use errorCode when raw numeric values are needed for logging or compatibility with native documentation.

The ErrorInfo Class

    public class ErrorInfo
    {
        public MCO_RET_E rc;
        public uint system_error;
        public string filename;
        public uint line;
    }

 

ErrorInfo class
Extended diagnostic information associated with some eXtremeDB failures.
rc
The typed MCO_RET_E code associated with the detailed error record.
system_error
Platform-specific system error value, if available.
filename
Name of the native source file or internal component that reported the error, when available.
line
Line number associated with the detailed error record, when available.

The MCO_RET_E Enumeration

    public enum MCO_RET_E
    {
        MCO_S_*,
        MCO_E_*,
        MCO_ERR_*
    }

 

MCO_RET_E enumeration
Managed enumeration of eXtremeDB return codes exposed by the C# wrapper.
MCO_S_*
Status values and non-fatal result codes, such as success, not-found conditions, duplicate detection, or cursor-end conditions.
MCO_E_*
Regular error codes returned by the runtime and its subsystems, including core, disk, network, HA, TL, sequence, DDL, backup, and SQL-related errors.
MCO_ERR_*
Fatal or internal error-code bases used by lower runtime layers.
Common Examples
Examples include MCO_S_OK, MCO_S_NOTFOUND, MCO_E_CONFLICT, MCO_E_CURSOR_CLOSED, MCO_E_INTERRUPTED, and many others defined by the runtime.
Reference Source
The C# enumeration mirrors the native return-code space. For the full list and native-level explanations, see C API Return Codes.