Energy Core Library
Energy.Source.Error Class Reference

Database exception helper More...

Classes

class  Result
 Exception catch result More...
 

Static Public Member Functions

static Result Catch (System.Exception exception, System.Data.IDbCommand command)
 Check exception from database connection. More...
 
static int [] GetErrorNumber (System.Exception exception)
 Get array of error numbers from database exception More...
 

Detailed Description

Database exception helper

Member Function Documentation

◆ Catch()

static Result Energy.Source.Error.Catch ( System.Exception  exception,
System.Data.IDbCommand  command 
)
static

Check exception from database connection.

True for timeout and damaged connections. They may be repeated. False otherwise which means that operation may not have a chance to succeed.

If exception may be temporary and can disappear after repeat, this function results true. If result is false, operation like syntax error is final and repeating command makes no sense.

Returns true if operation can be repeated.

Parameters
exception
command
Returns
True if operation can be repeated.

◆ GetErrorNumber()

static int [] Energy.Source.Error.GetErrorNumber ( System.Exception  exception)
static

Get array of error numbers from database exception

Parameters
exception
Returns

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