MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NdbError Struct Reference

Contains error information. More...

#include <NdbError.hpp>

Inheritance diagram for NdbError:

Public Types

enum  Status { Success = ndberror_st_success, TemporaryError = ndberror_st_temporary, PermanentError = ndberror_st_permanent, UnknownResult = ndberror_st_unknown }
enum  Classification {
  NoError = ndberror_cl_none, ApplicationError = ndberror_cl_application, NoDataFound = ndberror_cl_no_data_found, ConstraintViolation = ndberror_cl_constraint_violation,
  SchemaError = ndberror_cl_schema_error, UserDefinedError = ndberror_cl_user_defined, InsufficientSpace = ndberror_cl_insufficient_space, TemporaryResourceError = ndberror_cl_temporary_resource,
  NodeRecoveryError = ndberror_cl_node_recovery, OverloadError = ndberror_cl_overload, TimeoutExpired = ndberror_cl_timeout_expired, UnknownResultError = ndberror_cl_unknown_result,
  InternalError = ndberror_cl_internal_error, FunctionNotImplemented = ndberror_cl_function_not_implemented, UnknownErrorCode = ndberror_cl_unknown_error_code, NodeShutdown = ndberror_cl_node_shutdown,
  SchemaObjectExists = ndberror_cl_schema_object_already_exists, InternalTemporary = ndberror_cl_internal_temporary
}

Public Member Functions

 NdbError (const ndberror_struct &ndberror)
 operator ndberror_struct () const

Public Attributes

Status status
Classification classification
int code
int mysql_code
const char * message
char * details

Detailed Description

Contains error information.

A NdbError consists of five parts:

  1. Error status : Application impact
  2. Error classification : Logical error group
  3. Error code : Internal error code
  4. Error message : Context independent description of error
  5. Error details : Context dependent information (not always available)

Error status is usually used for programming against errors. If more detailed error control is needed, it is possible to use the error classification.

It is not recommended to write application programs dependent on specific error codes.

The error messages and error details may change without notice.

For example of use, see ndbapi_retries.cpp.

Definition at line 48 of file NdbError.hpp.

Member Enumeration Documentation

Type of error

Enumerator:
NoError 

Success. No error occurred.

ApplicationError 

Error in application program.

NoDataFound 

Read operation failed due to missing record.

ConstraintViolation 

E.g. inserting a tuple with a primary key already existing in the table.

SchemaError 

Error in creating table or usage of table.

UserDefinedError 

Error occurred in interpreted program.

InsufficientSpace 

E.g. insufficient memory for data or indexes.

TemporaryResourceError 

E.g. too many active transactions.

NodeRecoveryError 

Temporary failures which are probably inflicted by a node recovery in progress. Examples: information sent between application and NDB lost, distribution change.

OverloadError 

E.g. out of log file space.

TimeoutExpired 

Timeouts, often inflicted by deadlocks in NDB.

UnknownResultError 

Is is unknown whether the transaction was committed or not.

InternalError 

A serious error in NDB has occurred.

FunctionNotImplemented 

A function used is not yet implemented.

UnknownErrorCode 

Error handler could not determine correct error code.

NodeShutdown 

Node shutdown

SchemaObjectExists 

Schema object already exists

InternalTemporary 

Request sent to non master

Definition at line 91 of file NdbError.hpp.

Status categorizes error codes into status values reflecting what the application should do when encountering errors

Enumerator:
Success 

The error code indicate success
(Includes classification: NdbError::NoError)

TemporaryError 

The error code indicates a temporary error. The application should typically retry.
(Includes classifications: NdbError::InsufficientSpace, NdbError::TemporaryResourceError, NdbError::NodeRecoveryError, NdbError::OverloadError, NdbError::NodeShutdown and NdbError::TimeoutExpired.)

PermanentError 

The error code indicates a permanent error.
(Includes classificatons: NdbError::PermanentError, NdbError::ApplicationError, NdbError::NoDataFound, NdbError::ConstraintViolation, NdbError::SchemaError, NdbError::UserDefinedError, NdbError::InternalError, and, NdbError::FunctionNotImplemented.)

UnknownResult 

The result/status is unknown.
(Includes classifications: NdbError::UnknownResultError, and NdbError::UnknownErrorCode.)

Definition at line 53 of file NdbError.hpp.

Member Data Documentation

Classification NdbError::classification

Error type

Definition at line 194 of file NdbError.hpp.

int NdbError::code

Error code

Definition at line 199 of file NdbError.hpp.

char* NdbError::details

The detailed description. This is extra information regarding the error which is not included in the error message.

Note
Is NULL when no details specified

Definition at line 218 of file NdbError.hpp.

const char* NdbError::message

Error message

Definition at line 209 of file NdbError.hpp.

int NdbError::mysql_code

Mysql error code

Definition at line 204 of file NdbError.hpp.

Status NdbError::status

Error status.

Definition at line 189 of file NdbError.hpp.


The documentation for this struct was generated from the following file: