SDK v3 #8

Merged
SoXX merged 77 commits from dev/issue-5 into main 2024-08-14 13:27:35 +00:00
2 changed files with 20 additions and 24 deletions
Showing only changes of commit b8e29de4fc - Show all commits

View File

@ -1,25 +1,19 @@
package error package error
type EntityAlreadyExists struct{} import "fmt"
func (e *EntityAlreadyExists) Error() string { const (
return "EntityAlreadyExists error" EntityAlreadyExists = "EntityAlreadyExists"
NoDataWritten = "NoDataWritten"
NoDataFound = "NoDataFound"
DatabaseIsNotConnected = "database is not connected"
DuplicateKey = "DuplicateKey"
)
type Database struct {
Reason string
} }
type NoDataWritten struct{} func (e Database) Error() string {
return fmt.Sprintf("Database error: %s", e.Reason)
func (e *NoDataWritten) Error() string {
return "NoDataWritten error"
}
type NoDataFound struct{}
func (e *NoDataFound) Error() string {
return "NoDataFound error"
}
type NoRelationCreated struct{}
func (e *NoRelationCreated) Error() string {
return "relationship creation error"
} }

View File

@ -3,11 +3,13 @@ package error
import "fmt" import "fmt"
const ( const (
AnthroveUserIDIsEmpty = "anthrovePostID cannot be empty" UserIDIsEmpty = "anthrovePostID cannot be empty"
AnthroveUserIDToShort = "anthrovePostID needs to be 25 characters long" UserIDToShort = "anthrovePostID needs to be 25 characters long"
AnthroveSourceIDEmpty = "anthroveSourceID cannot be empty" SourceIDEmpty = "anthroveSourceID cannot be empty"
AnthroveSourceIDToShort = "anthroveSourceID needs to be 25 characters long" SourceIDToShort = "anthroveSourceID needs to be 25 characters long"
AnthroveTagIDEmpty = "tagID cannot be empty" UserSourceIDEmpty = "anthroveUserSourceID cannot be empty"
UserSourceIDToShort = "anthroveUserSourceID needs to be 25 characters long"
TagIDEmpty = "tagID cannot be empty"
) )
type EntityValidationFailed struct { type EntityValidationFailed struct {