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

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package achaemenid
     4  
     5  import (
     6  	er "../error"
     7  	"../protocol"
     8  )
     9  
    10  const errorEnglishDomain = "Achaemenid"
    11  const errorPersianDomain = "فرمانده"
    12  
    13  // Errors
    14  var (
    15  	ErrNoConnection = er.New("urn:giti:achaemenid.giti:error:no-connection").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "No Connection",
    16  		"No connection exist to complete request due to temporary or long term problem",
    17  		"",
    18  		"").
    19  		SetDetail(protocol.LanguagePersian, errorPersianDomain, "ارتباط قطع",
    20  			"ارتباطی جهت انجام رخواست مورد نظر بدلیل وجود مشکل موقت یا دایم وجود ندارد",
    21  			"",
    22  			"").Save()
    23  
    24  	ErrSendRequest = er.New("urn:giti:achaemenid.giti:error:send-request").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Send Request",
    25  		"Send request encounter problem due to temporary or long term problem!",
    26  		"",
    27  		"").Save()
    28  
    29  	ErrReceiveResponse = er.New("urn:giti:achaemenid.giti:error:receive-response").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Receive Respone",
    30  		"Receive response encounter problem due to temporary or long term problem!",
    31  		"",
    32  		"").Save()
    33  
    34  	ErrBadRequest = er.New("urn:giti:achaemenid.giti:error:bad-request").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Bad Request",
    35  		"Some given data in request must be invalid or peer not accept them",
    36  		"",
    37  		"").Save()
    38  
    39  	ErrBadResponse = er.New("urn:giti:achaemenid.giti:error:bad-response").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Bad Response",
    40  		"Response data from peer is not valid",
    41  		"",
    42  		"").Save()
    43  
    44  	ErrInternalError = er.New("urn:giti:achaemenid.giti:error:internal-error").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Internal Error",
    45  		"Peer encounter problem due to temporary or long term problem!",
    46  		"",
    47  		"").Save()
    48  
    49  	ErrProtocolHandler = er.New("urn:giti:achaemenid.giti:error:protocol-handler").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Protocol Handler",
    50  		"Protocol handler not exist to complete the request",
    51  		"",
    52  		"").Save()
    53  
    54  	ErrGuestConnectionNotAllow = er.New("urn:giti:achaemenid.giti:error:guest-connection-not-allow").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Guest Connection Not Allow",
    55  		"Guest users don't allow to make new connection",
    56  		"",
    57  		"").Save()
    58  
    59  	ErrGuestConnectionMaxReached = er.New("urn:giti:achaemenid.giti:error:guest-connection-max-reached").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Guest Connection Max Reached",
    60  		"Server not have enough resource to make new guest connection, try few minutes later or try other server",
    61  		"",
    62  		"").Save()
    63  
    64  		ErrNotStandardID = er.New("urn:giti:giti:error:not-standard-id").SetDetail(protocol.LanguageEnglish, errorEnglishDomain, "Not Standard ID",
    65  		"You set non standard ID for error||service||data-structure||..., It can cause some bad situation in your platform",
    66  		"",
    67  		"").Save()
    68  )