func (e *IOException) GetErrorCode() string {
	return e.ErrorCode
}
///////////////////////////////////////////////////////////////
Implement functions from Interface ==> TGError
///////////////////////////////////////////////////////////////
package impl
import (
	"fmt"
	"tgdb"
)
const (
	TGErrorBadVerb = iota
	TGErrorInvalidMessageLength
	TGErrorBadMagic
	TGErrorProtocolNotSupported
	TGErrorBadAuthentication
	TGErrorIOException
	TGErrorConnectionTimeout
	TGErrorGeneralException
	TGErrorRetryIOException
	TGErrorChannelDisconnected
	TGErrorSecurityException
	TGErrorTransactionException
	TGErrorTypeCoercionNotSupported
	TGErrorTypeNotSupported
	TGErrorVersionMismatchException
	TGErrorInvalidErrorCode
	TGSuccess
	TGQryError
    TGQryProviderNotInitialized
    TGQryParsingError
    TGQryStepNotSupported
    TGQryStepNotAllowed
    TGQryStepArgMissing
    TGQryStepArgNotSupported
    TGQryStepMissing
    TGQryNotDefined
    TGQryAttrDescNotFound
    TGQryEdgeTypeNotFound
    TGQryNodeTypeNotFound
    TGQryInternalDataMismatchError
    TGQryStepSignatureNotSupported
    TGQryInvalidDataType
)
const (
	TGQueryInvalid = iota + 8100
	TGQueryProviderNotInitialized
	TGQueryParsingError
	TGQueryStepNotSupported
	TGQueryStepNotAllowed
	TGQueryStepArgMissing
	TGQueryStepArgNotSupported
	TGQueryStepMissing
	TGQueryNotDefined
	TGQueryAttrDescNotFound
	TGQueryEdgeTypeNotFound
	TGQueryNodeTypeNotFound
	TGQueryInternalDataMismatchError
	TGQueryStepSignatureNotSupported
	TGQueryInvalidDataType
	TGQueryErrorCodeEndMarker
)
type TGDBError struct {
	ErrorCode    string
	ErrorType    int
	ErrorMsg     string
	ErrorDetails string
	ErrorServerErrorCode int
}
func (e *TGDBError) GetErrorCode() string {
	return e.ErrorCode
}
func (e *TGDBError) GetErrorType() int {
	return e.ErrorType
}
func (e *TGDBError) GetErrorMsg() string {
	return e.ErrorMsg
}
func (e *TGDBError) GetErrorDetails() string {
	return e.ErrorDetails
}
func (e *TGDBError) GetServerErrorCode() int {
	return e.ErrorServerErrorCode
}
var PreDefinedErrors = map[int]TGDBError{
	TGErrorBadVerb:                  {ErrorCode: "TGErrorBadVerb", ErrorType: TGErrorBadVerb, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorInvalidMessageLength:     {ErrorCode: "TGErrorInvalidMessageLength", ErrorType: TGErrorInvalidMessageLength, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorBadMagic:                 {ErrorCode: "TGErrorBadMagic", ErrorType: TGErrorBadMagic, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorProtocolNotSupported:     {ErrorCode: "TGErrorProtocolNotSupported", ErrorType: TGErrorProtocolNotSupported, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorBadAuthentication:        {ErrorCode: "TGErrorBadAuthentication", ErrorType: TGErrorBadAuthentication, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorIOException:              {ErrorCode: "TGErrorIOException", ErrorType: TGErrorIOException, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorConnectionTimeout:        {ErrorCode: "TGErrorConnectionTimeout", ErrorType: TGErrorConnectionTimeout, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorGeneralException:         {ErrorCode: "TGErrorGeneralException", ErrorType: TGErrorGeneralException, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorRetryIOException:         {ErrorCode: "TGErrorRetryIOException", ErrorType: TGErrorRetryIOException, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorChannelDisconnected:      {ErrorCode: "TGErrorChannelDisconnected", ErrorType: TGErrorChannelDisconnected, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorSecurityException:        {ErrorCode: "TGErrorSecurityException", ErrorType: TGErrorSecurityException, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorTransactionException:     {ErrorCode: "TGErrorTransactionException", ErrorType: TGErrorTransactionException, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorTypeCoercionNotSupported: {ErrorCode: "TGErrorTypeCoercionNotSupported", ErrorType: TGErrorTypeCoercionNotSupported, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorTypeNotSupported:         {ErrorCode: "TGErrorTypeNotSupported", ErrorType: TGErrorTypeNotSupported, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorVersionMismatchException: {ErrorCode: "TGErrorVersionMismatchException", ErrorType: TGErrorVersionMismatchException, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGErrorInvalidErrorCode:         {ErrorCode: "TGErrorInvalidErrorCode", ErrorType: TGErrorInvalidErrorCode, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
	TGSuccess:                       {ErrorCode: "TGSuccess", ErrorType: TGSuccess, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1},
}
func DefaultTGDBError() *TGDBError {
	newTGDBError := TGDBError{ErrorCode: "", ErrorType: TGSuccess, ErrorMsg: "", ErrorDetails: "", ErrorServerErrorCode:-1}
	return &newTGDBError
}
func NewTGDBError(eCode string, eType int, eMsg, eDetails string) *TGDBError {
	newTGDBError := DefaultTGDBError()
	newTGDBError.ErrorCode = eCode
	newTGDBError.ErrorType = eType
	newTGDBError.ErrorMsg = eMsg
	newTGDBError.ErrorDetails = eDetails
	return newTGDBError
}
func NewTGDBErrorWithServerErrorCode(eCode string, eType int, eMsg, eDetails string, eServerErrorCode int) *TGDBError {
	newTGDBError := NewTGDBError(eCode, eType, eMsg, eDetails)
	newTGDBError.ErrorServerErrorCode = eServerErrorCode
	return newTGDBError
}
func GetPreDefinedErrors(code string) *TGDBError {
	for _, tgError := range PreDefinedErrors {
		if tgError.ErrorCode == code {
			return &tgError
		}
	}
	invalid := PreDefinedErrors[TGErrorInvalidErrorCode]
	return &invalid
}
func (e *TGDBError) Error() string {
	errMsg := fmt.Sprintf("ErrorCode: %s, ErrorType: %d, ErrorMessage: %s, ErrorDetails: %s", e.ErrorCode, e.ErrorType, e.ErrorMsg, e.ErrorDetails)
	return errMsg
}
func CreateExceptionByType(excpTypeId int) tgdb.TGError {
	inputExcpTypeId := excpTypeId
	switch inputExcpTypeId {
	case TGSuccess:
		return DefaultTGSuccess()
	case TGErrorBadAuthentication:
		return DefaultTGBadAuthentication()
	case TGErrorBadMagic:
		return DefaultTGBadMagic()
	case TGErrorBadVerb:
		return DefaultTGBadVerb()
	case TGErrorChannelDisconnected:
		return DefaultTGChannelDisconnected()
	case TGErrorConnectionTimeout:
		return DefaultTGConnectionTimeout()
	case TGErrorGeneralException:
		return DefaultTGGeneralException()
	case TGErrorInvalidMessageLength:
		return DefaultTGInvalidMessageLength()
	case TGErrorIOException:
		return DefaultTGIOException()
	case TGErrorProtocolNotSupported:
		return DefaultTGProtocolNotSupported()
	case TGErrorRetryIOException:
		return DefaultTGRetryIOException()
	case TGErrorSecurityException:
		return DefaultTGSecurityException()
	case TGErrorTransactionException:
		return DefaultTGTransactionException()
	case TGErrorTypeCoercionNotSupported:
		return DefaultTGTypeCoercionNotSupported()
	case TGErrorTypeNotSupported:
		return DefaultTGTypeNotSupported()
	case TGErrorVersionMismatchException:
		return DefaultTGVersionMismatchException()
	case TGErrorInvalidErrorCode:
		fallthrough
	default:
		return GetPreDefinedErrors("TGErrorInvalidErrorCode")
	}
	return nil
}
func GetErrorByType(excpTypeId int, errorCode, errorMsg, errorDetails string) tgdb.TGError {
	inputExcpTypeId := excpTypeId
	switch inputExcpTypeId {
	case TGSuccess:
		return NewTGSuccess(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorBadAuthentication:
		return NewTGBadAuthentication(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorBadMagic:
		return NewTGBadMagic(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorBadVerb:
		return NewTGBadVerb(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorChannelDisconnected:
		return NewTGChannelDisconnected(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorConnectionTimeout:
		return NewTGConnectionTimeout(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorGeneralException:
		return NewTGGeneralException(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorInvalidMessageLength:
		return NewTGInvalidMessageLength(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorIOException:
		return NewTGIOException(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorProtocolNotSupported:
		return NewTGProtocolNotSupported(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorRetryIOException:
		return NewTGRetryIOException(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorSecurityException:
		return NewTGSecurityException(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorTransactionException:
		return NewTGTransactionException(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorTypeCoercionNotSupported:
		return NewTGTypeCoercionNotSupported(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorTypeNotSupported:
		return NewTGTypeNotSupported(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorVersionMismatchException:
		return NewTGVersionMismatchException(errorCode, excpTypeId, errorMsg, errorDetails)
	case TGErrorInvalidErrorCode:
		fallthrough
	default:
		return GetPreDefinedErrors("TGErrorInvalidErrorCode")
	}
	return nil
}
func GetErrorDetails(excpTypeId int) string {
	tgDbError := CreateExceptionByType(excpTypeId)
	if tgDbError != nil {
		return tgDbError.GetErrorDetails()
	}
	return tgDbError.GetErrorDetails()
}
func Error(excpTypeId int) string {
	tgDbError := CreateExceptionByType(excpTypeId)
	if tgDbError != nil {
		return tgDbError.Error()
	}
	return tgDbError.Error()
}
type Success struct {
	*TGDBError
}
func DefaultTGSuccess() *Success {
	newException := Success{
		TGDBError: DefaultTGDBError(),
	}
	newException.ErrorType = TGSuccess
	return &newException
}
func NewTGSuccess(eCode string, eType int, eMsg, eDetails string) *Success {
	newException := DefaultTGSuccess()
	newException.ErrorCode = eCode
	newException.ErrorType = eType
	newException.ErrorMsg = eMsg
	newException.ErrorDetails = eDetails
	return newException
}
func NewTGSuccessWithMsg(msg string) *Success {
	newException := DefaultTGSuccess()
	newException.ErrorMsg = msg
	return newException
}
func (e *Success) GetErrorCode() string {
	return e.ErrorCode
}
func (e *Success) GetErrorType() int {
	return e.ErrorType
}
func (e *Success) GetErrorMsg() string {
	return e.ErrorMsg
}
func (e *Success) GetErrorDetails() string {
	return e.ErrorDetails
}
func (e *Success) Error() string {
	errMsg := fmt.Sprintf("ErrorCode: %s, ErrorType: %d, ErrorMessage: %s, ErrorDetails: %s", e.ErrorCode, e.ErrorType, e.ErrorMsg, e.ErrorDetails)
	return errMsg
}
type BadAuthentication struct {
	*TGDBError
	realm string
}
func DefaultTGBadAuthentication() *BadAuthentication {
	newException := BadAuthentication{
		TGDBError: DefaultTGDBError(),
	}
	newException.ErrorType = TGErrorBadAuthentication
	newException.realm = ""
	return &newException
}
func NewTGBadAuthentication(eCode string, eType int, eMsg, eDetails string) *BadAuthentication {
	newException := DefaultTGBadAuthentication()
	newException.ErrorCode = eCode
	newException.ErrorType = eType
	newException.ErrorMsg = eMsg
	newException.ErrorDetails = eDetails
	return newException
}
func NewTGBadAuthenticationWithMsg(msg string) *BadAuthentication {
	newException := DefaultTGBadAuthentication()
	newException.ErrorMsg = msg
	return newException
}
func NewTGBadAuthenticationWithRealm(eCode string, eType int, eMsg, eDetails string, realm string) *BadAuthentication {
	newException := NewTGBadAuthentication(eCode, eType, eMsg, eDetails)
	newException.realm = realm
	return newException
}
func (e *BadAuthentication) GetRealm() string {
	return e.realm
}
func (e *BadAuthentication) SetRealm(realmStr string) {
	e.realm = realmStr
}
func (e *BadAuthentication) GetErrorCode() string {
	return e.ErrorCode
}
func (e *BadAuthentication) GetErrorType() int {
	return e.ErrorType
}
func (e *BadAuthentication) GetErrorMsg() string {
	return e.ErrorMsg
}
func (e *BadAuthentication) GetErrorDetails() string {
	return e.ErrorDetails
}
func (e *BadAuthentication) Error() string {
	errMsg := fmt.Sprintf("realm: %s, ErrorCode: %s, ErrorType: %d, ErrorMessage: %s, ErrorDetails: %s", e.realm, e.ErrorCode, e.ErrorType, e.ErrorMsg, e.ErrorDetails)
	return errMsg
}
type BadMagic struct {
	*TGDBError
}
func DefaultTGBadMagic() *BadMagic {
	newException := BadMagic{
		TGDBError: DefaultTGDBError(),
	}
	newException.ErrorType = TGErrorBadMagic
	return &newException
}
func NewTGBadMagic(eCode string, eType int, eMsg, eDetails string) *BadMagic {
	newException := DefaultTGBadMagic()
	newException.ErrorCode = eCode
	newException.ErrorType = eType
	newException.ErrorMsg = eMsg
	newException.ErrorDetails = eDetails
	return newException
}
func NewTGBadMagicWithMsg(msg string) *BadMagic {
	newException := DefaultTGBadMagic()
	newException.ErrorMsg = msg
	return newException
}
func (e *BadMagic) GetErrorCode() string {
	return e.ErrorCode
}
func (e *BadMagic) GetErrorType() int {
	return e.ErrorType
}
func (e *BadMagic) GetErrorMsg() string {
	return e.ErrorMsg
}
func (e *BadMagic) GetErrorDetails() string {
	return e.ErrorDetails
}
func (e *BadMagic) Error() string {
	errMsg := fmt.Sprintf("ErrorCode: %s, ErrorType: %d, ErrorMessage: %s, ErrorDetails: %s", e.ErrorCode, e.ErrorType, e.ErrorMsg, e.ErrorDetails)
	return errMsg
}
type BadVerb struct {
	*TGDBError
}
func DefaultTGBadVerb() *BadVerb {
	newException := BadVerb{
		TGDBError: DefaultTGDBError(),
	}
	newException.ErrorType = TGErrorBadVerb
	return &newException
}
func NewTGBadVerb(eCode string, eType int, eMsg, eDetails string) *BadVerb {
	newException := DefaultTGBadVerb()
	newException.ErrorCode = eCode
	newException.ErrorType = eType
	newException.ErrorMsg = eMsg
	newException.ErrorDetails = eDetails
	return newException
}
func NewTGBadVerbWithMsg(msg string) *BadVerb {
	newException := DefaultTGBadVerb()
	newException.ErrorMsg = msg
	return newException
}
func (e *BadVerb) GetErrorCode() string {
	return e.ErrorCode
}
func (e *BadVerb) GetErrorType() int {
	return e.ErrorType
}
func (e *BadVerb) GetErrorMsg() string {
	return e.ErrorMsg
}
func (e *BadVerb) GetErrorDetails() string {
	return e.ErrorDetails
}
func (e *BadVerb) Error() string {
	errMsg := fmt.Sprintf("ErrorCode: %s, ErrorType: %d, ErrorMessage: %s, ErrorDetails: %s", e.ErrorCode, e.ErrorType, e.ErrorMsg, e.ErrorDetails)
	return errMsg
}
type ChannelDisconnected struct {
	*TGDBError
}
func DefaultTGChannelDisconnected() *ChannelDisconnected {
	newException := ChannelDisconnected{
		TGDBError: DefaultTGDBError(),
	}
	newException.ErrorType = TGErrorChannelDisconnected
	return &newException
}
func NewTGChannelDisconnected(eCode string, eType int, eMsg, eDetails string) *ChannelDisconnected {
	newException := DefaultTGChannelDisconnected()
	newException.ErrorCode = eCode
	newException.ErrorType = eType
	newException.ErrorMsg = eMsg
	newException.ErrorDetails = eDetails
	return newException
}
func NewTGChannelDisconnectedWithMsg(msg string) *ChannelDisconnected {
	newException := DefaultTGChannelDisconnected()
	newException.ErrorMsg = msg
	return newException
}
func (e *ChannelDisconnected) GetErrorCode() string {
	return e.ErrorCode
}
func (e *ChannelDisconnected) GetErrorType() int {
	return e.ErrorType
}
func (e *ChannelDisconnected) GetErrorMsg() string {
	return e.ErrorMsg
}
func (e *ChannelDisconnected) GetErrorDetails() string {
	return e.ErrorDetails
}
func (e *ChannelDisconnected) Error() string {
	errMsg := fmt.Sprintf("ErrorCode: %s, ErrorType: %d, ErrorMessage: %s, ErrorDetails: %s", e.ErrorCode, e.ErrorType, e.ErrorMsg, e.ErrorDetails)
	return errMsg
}
type ConnectionTimeout struct {
	*TGDBError
}
func DefaultTGConnectionTimeout() *ConnectionTimeout {
	newException := ConnectionTimeout{
		TGDBError: DefaultTGDBError(),
	}
	newException.ErrorType = TGErrorConnectionTimeout
	return &newException
}
func NewTGConnectionTimeout(eCode string, eType int, eMsg, eDetails string) *ConnectionTimeout {
	newException := DefaultTGConnectionTimeout()
	newException.ErrorCode = eCode
	newException.ErrorType = eType
	newException.ErrorMsg = eMsg
	newException.ErrorDetails = eDetails
	return newException
}
func NewTGConnectionTimeoutWithMsg(msg string) *ConnectionTimeout {
	newException := DefaultTGConnectionTimeout()
	newException.ErrorMsg = msg
	return newException
}
func (e *ConnectionTimeout) GetErrorCode() string {
	return e.ErrorCode
}
func (e *ConnectionTimeout) GetErrorType() int {
	return e.ErrorType
}
func (e *ConnectionTimeout) GetErrorMsg() string {
	return e.ErrorMsg
}
func (e *ConnectionTimeout) GetErrorDetails() string {
	return e.ErrorDetails
}
func (e *ConnectionTimeout) Error() string {
	errMsg := fmt.Sprintf("ErrorCode: %s, ErrorType: %d, ErrorMessage: %s, ErrorDetails: %s", e.ErrorCode, e.ErrorType, e.ErrorMsg, e.ErrorDetails)
	return errMsg
}
type GeneralException struct {
	*TGDBError
}
func DefaultTGGeneralException() *GeneralException {
	newException := GeneralException{
		TGDBError: DefaultTGDBError(),
	}
	newException.ErrorType = TGErrorGeneralException
	return &newException
}
func NewTGGeneralException(eCode string, eType int, eMsg, eDetails string) *GeneralException {
	newException := DefaultTGGeneralException()
	newException.ErrorCode = eCode
	newException.ErrorType = eType
	newException.ErrorMsg = eMsg
	newException.ErrorDetails = eDetails
	return newException
}
func NewTGGeneralExceptionWithMsg(msg string) *GeneralException {
	newException := DefaultTGGeneralException()
	newException.ErrorMsg = msg
	return newException
}
func (e *GeneralException) GetErrorCode() string {
	return e.ErrorCode
}
func (e *GeneralException) GetErrorType() int {
	return e.ErrorType
}
func (e *GeneralException) GetErrorMsg() string {
	return e.ErrorMsg
}
func (e *GeneralException) GetErrorDetails() string {
	return e.ErrorDetails
}
func (e *GeneralException) Error() string {
	errMsg := fmt.Sprintf("ErrorCode: %s, ErrorType: %d, ErrorMessage: %s, ErrorDetails: %s", e.ErrorCode, e.ErrorType, e.ErrorMsg, e.ErrorDetails)
	return errMsg
}
type InvalidMessageLength struct {
	*TGDBError
}
func DefaultTGInvalidMessageLength() *InvalidMessageLength {
	newException := InvalidMessageLength{
		TGDBError: DefaultTGDBError(),
	}
	newException.ErrorType = TGErrorInvalidMessageLength
	return &newException
}
func NewTGInvalidMessageLength(eCode string, eType int, eMsg, eDetails string) *InvalidMessageLength {
	newException := DefaultTGInvalidMessageLength()
	newException.ErrorCode = eCode
	newException.ErrorType = eType
	newException.ErrorMsg = eMsg
	newException.ErrorDetails = eDetails
	return newException
}
func NewTGInvalidMessageLengthWithMsg(msg string) *InvalidMessageLength {
	newException := DefaultTGInvalidMessageLength()
	newException.ErrorMsg = msg
	return newException
}
func (e *InvalidMessageLength) GetErrorCode() string {
	return e.ErrorCode
}
func (e *InvalidMessageLength) GetErrorType() int {
	return e.ErrorType
}
func (e *InvalidMessageLength) GetErrorMsg() string {
	return e.ErrorMsg
}
func (e *InvalidMessageLength) GetErrorDetails() string {
	return e.ErrorDetails
}
func (e *InvalidMessageLength) Error() string {
	errMsg := fmt.Sprintf("ErrorCode: %s, ErrorType: %d, ErrorMessage: %s, ErrorDetails: %s", e.ErrorCode, e.ErrorType, e.ErrorMsg, e.ErrorDetails)
	return errMsg
}
type IOException struct {
	*TGDBError
}
func DefaultTGIOException() *IOException {
	newException := IOException{
		TGDBError: DefaultTGDBError(),
	}
	newException.ErrorType = TGErrorIOException
	return &newException
}
func NewTGIOException(eCode string, eType int, eMsg, eDetails string) *IOException {
	newException := DefaultTGIOException()
	newException.ErrorCode = eCode
	newException.ErrorType = eType
	newException.ErrorMsg = eMsg
	newException.ErrorDetails = eDetails
	return newException
}
func NewTGIOExceptionWithMsg(msg string) *IOException {
	newException := DefaultTGIOException()
	newException.ErrorMsg = msg
	return newException
}