github.com/geniusesgroup/libgo@v0.0.0-20220713101832-828057a9d3d4/matn/errors.go (about)

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package matn
     4  
     5  import (
     6  	er "../error"
     7  	"../protocol"
     8  )
     9  
    10  const domainEnglish = "Text"
    11  const domainPersian = "متن"
    12  
    13  // Errors
    14  var (
    15  	ErrRecordNil         er.Error
    16  	ErrRecordNotValid    er.Error
    17  	ErrRecordNotExist    er.Error
    18  	ErrRecordManipulated er.Error
    19  )
    20  
    21  func init() {
    22  	ErrRecordNil.Init("domain/matn.protocol.error; name=record-nil")
    23  	ErrRecordNil.SetDetail(protocol.LanguageEnglish, domainEnglish, "Record Nil",
    24  		"Given record can't be nil",
    25  		"",
    26  		"",
    27  		nil)
    28  
    29  	ErrRecordNotValid.Init("domain/matn.protocol.error; name=record-not-valid")
    30  	ErrRecordNotValid.SetDetail(protocol.LanguageEnglish, domainEnglish, "Record Not Valid",
    31  		"Given recordID exist in storage devices but has different StructureID",
    32  		"",
    33  		"",
    34  		nil)
    35  
    36  	ErrRecordNotExist.Init("domain/matn.protocol.error; name=record-not-exist")
    37  	ErrRecordNotExist.SetDetail(protocol.LanguageEnglish, domainEnglish, "Record Not Exist",
    38  		"Given recordID not exist in any storage devices",
    39  		"",
    40  		"",
    41  		nil)
    42  
    43  	ErrRecordManipulated.Init("domain/matn.protocol.error; name=record-manipulated")
    44  	ErrRecordManipulated.SetDetail(protocol.LanguageEnglish, domainEnglish, "Record Manipulated",
    45  		"Index record has problem when engine try to read it from storage devices",
    46  		"",
    47  		"",
    48  		nil)
    49  }