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

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package ganjine
     4  
     5  import (
     6  	er "../error"
     7  	"../protocol"
     8  )
     9  
    10  const domainEnglish = "Ganjine"
    11  const domainPersian = "گنجینه"
    12  
    13  // Errors
    14  var (
    15  	ErrBadNode   er.Error
    16  	ErrWrongNode er.Error
    17  	// ErrContentAlreadyExist     er.Error
    18  	// ErrCantPrepareStatement    er.Error
    19  	// ErrStoringDataNotComplete  er.Error
    20  	// ErrDatabaseConnectionError er.Error
    21  	// ErrDatabasePingOut         er.Error
    22  )
    23  
    24  func init() {
    25  	ErrBadNode.Init("urn:giti:ganjine.protocol:error:bad-node")
    26  	ErrBadNode.SetDetail(protocol.LanguageEnglish, domainEnglish, "Bad Node",
    27  		"Given request can't proccess due to send to an non Ganjine node",
    28  		"",
    29  		"",
    30  		nil)
    31  
    32  	ErrWrongNode.Init("urn:giti:ganjine.protocol:error:wrong-node")
    33  	ErrWrongNode.SetDetail(protocol.LanguageEnglish, domainEnglish, "Wrong Node",
    34  		"Given request can't proccess due to send to a Ganjine node that not own the request range!",
    35  		"",
    36  		"",
    37  		nil)
    38  
    39  	// ErrContentAlreadyExist     = er.New("This content was already exist")
    40  	// ErrCantPrepareStatement    = er.New("Can't prepare a new statement to database")
    41  	// ErrStoringDataNotComplete  = er.New("We have some problem in storing your data in our databases. Send your request again! If error exist contact SabzCity platform administrators")
    42  	// ErrDatabaseConnectionError = er.New("Could not connect to database")
    43  	// ErrDatabasePingOut         = er.New("Error ocurred in Ping to database")
    44  }