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

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package object
     4  
     5  import (
     6  	er "../error"
     7  	"../protocol"
     8  )
     9  
    10  const errorEnglishDomain = "Object"
    11  const errorPersianDomain = "ابجکت"
    12  
    13  // Errors
    14  var (
    15  	ErrDeviceProblem = er.New("urn:giti:object.protocol:error:device-problem").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Device Problem",
    16  		"Requested object exist on the device that had problem to access it!",
    17  		"",
    18  		"").Save()
    19  
    20  	ErrExist = er.New("urn:giti:object.protocol:error:exist").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Object Exist",
    21  		"Request to make new object can't proccessed due to UUID already exist",
    22  		"",
    23  		"").Save()
    24  
    25  	ErrNotExist = er.New("urn:giti:object.protocol:error:not-exist").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Not Exist",
    26  		"Requested object not exist",
    27  		"",
    28  		"").Save()
    29  
    30  	ErrNotAuthorize = er.New("urn:giti:object.protocol:error:not-authorize").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Not Authorized",
    31  		"Requested object belong to other app owner and this app can't access to it",
    32  		"",
    33  		"").Save()
    34  
    35  	ErrMisMatchedStructureID = er.New("urn:giti:object.protocol:error:mis-matched-structure-id").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Mis Matched StructureID",
    36  		"Can't read object data due to it StructureID not match with desire one",
    37  		"",
    38  		"").Save()
    39  
    40  	ErrObjectNotFound = er.New("urn:giti:object.protocol:error:object-not-found").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Object Not Found",
    41  		"Can't find a object with desire data",
    42  		"",
    43  		"").SetDetail(protocol.LanguagePersian, errorPersianDomain, "رکود یافت نشد",
    44  		"رکورد با مشخصات مورد نظر یافت نشد",
    45  		"",
    46  		"").Save()
    47  
    48  	ErrSourceNotChangeable = er.New("urn:giti:object.protocol:error:source-not-changeable").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Source not Changeable",
    49  		"Can't read from other source than object source",
    50  		"You can't set/write data in this way",
    51  		"Use Save() method in the object directory").Save()
    52  )