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
type EntityAlreadyExists struct{}
import "fmt"
func (e *EntityAlreadyExists) Error() string {
return "EntityAlreadyExists error"
const (
EntityAlreadyExists = "EntityAlreadyExists"
NoDataWritten = "NoDataWritten"
NoDataFound = "NoDataFound"
DatabaseIsNotConnected = "database is not connected"
DuplicateKey = "DuplicateKey"
)
type Database struct {
Reason string
}
type NoDataWritten struct{}
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"
func (e Database) Error() string {
return fmt.Sprintf("Database error: %s", e.Reason)
}

View File

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