github.com/mailru/activerecord@v1.12.2/internal/pkg/arerror/checker.go (about)

     1  package arerror
     2  
     3  import (
     4  	"errors"
     5  )
     6  
     7  var ErrCheckBackendEmpty = errors.New("backend empty")
     8  var ErrCheckBackendUnknown = errors.New("backend unknown")
     9  var ErrCheckEmptyNamespace = errors.New("empty namespace")
    10  var ErrCheckPkgBackendToMatch = errors.New("many backends for one class not supported yet")
    11  var ErrCheckFieldSerializerNotFound = errors.New("serializer not found")
    12  var ErrCheckFieldSerializerNotSupported = errors.New("serializer not supported")
    13  var ErrCheckFieldInvalidFormat = errors.New("invalid format")
    14  var ErrCheckFieldMutatorConflictPK = errors.New("conflict mutators with primary_key")
    15  var ErrCheckFieldMutatorConflictSerializer = errors.New("conflict mutators with serializer")
    16  var ErrCheckFieldMutatorConflictObject = errors.New("conflict mutators with object link")
    17  var ErrCheckFieldSerializerConflictObject = errors.New("conflict serializer with object link")
    18  var ErrCheckServerEmpty = errors.New("serverConf and serverHost is empty")
    19  var ErrCheckPortEmpty = errors.New("serverPort is empty")
    20  var ErrCheckServerConflict = errors.New("conflict ServerHost and serverConf params")
    21  var ErrCheckFieldIndexEmpty = errors.New("field for index is empty")
    22  var ErrCheckObjectNotFound = errors.New("linked object not found")
    23  var ErrCheckFieldTypeNotFound = errors.New("procedure field type not found")
    24  var ErrCheckFieldsEmpty = errors.New("empty required field declaration")
    25  var ErrCheckFieldsManyDecl = errors.New("few declarations of fields not supported")
    26  var ErrCheckFieldsOrderDecl = errors.New("incorrect order of fields")
    27  
    28  // Описание ошибки декларации пакета
    29  type ErrCheckPackageDecl struct {
    30  	Pkg     string
    31  	Backend string
    32  	Err     error
    33  }
    34  
    35  func (e *ErrCheckPackageDecl) Error() string {
    36  	return ErrorBase(e)
    37  }
    38  
    39  // Описание ошибки декларации неймспейса
    40  type ErrCheckPackageNamespaceDecl struct {
    41  	Pkg  string
    42  	Name string
    43  	Err  error
    44  }
    45  
    46  func (e *ErrCheckPackageNamespaceDecl) Error() string {
    47  	return ErrorBase(e)
    48  }
    49  
    50  // Описание ошибки декларации связанных сущностей
    51  type ErrCheckPackageLinkedDecl struct {
    52  	Pkg    string
    53  	Object string
    54  	Err    error
    55  }
    56  
    57  func (e *ErrCheckPackageLinkedDecl) Error() string {
    58  	return ErrorBase(e)
    59  }
    60  
    61  // Описание ошибки декларации полей
    62  type ErrCheckPackageFieldDecl struct {
    63  	Pkg   string
    64  	Field string
    65  	Err   error
    66  }
    67  
    68  func (e *ErrCheckPackageFieldDecl) Error() string {
    69  	return ErrorBase(e)
    70  }
    71  
    72  // Описание ошибки декларации мутаторов
    73  type ErrCheckPackageFieldMutatorDecl struct {
    74  	Pkg     string
    75  	Field   string
    76  	Mutator string
    77  	Err     error
    78  }
    79  
    80  func (e *ErrCheckPackageFieldMutatorDecl) Error() string {
    81  	return ErrorBase(e)
    82  }
    83  
    84  // Описание ошибки декларации индексов
    85  type ErrCheckPackageIndexDecl struct {
    86  	Pkg   string
    87  	Index string
    88  	Err   error
    89  }
    90  
    91  func (e *ErrCheckPackageIndexDecl) Error() string {
    92  	return ErrorBase(e)
    93  }