2024-07-19 08:03:35 +00:00
|
|
|
package error
|
|
|
|
|
2024-08-09 20:14:13 +00:00
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
const (
|
|
|
|
EntityAlreadyExists = "EntityAlreadyExists"
|
|
|
|
NoDataWritten = "NoDataWritten"
|
|
|
|
NoDataFound = "NoDataFound"
|
|
|
|
DatabaseIsNotConnected = "database is not connected"
|
|
|
|
DuplicateKey = "DuplicateKey"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Database struct {
|
|
|
|
Reason string
|
2024-07-19 08:03:35 +00:00
|
|
|
}
|
|
|
|
|
2024-08-09 20:14:13 +00:00
|
|
|
func (e Database) Error() string {
|
|
|
|
return fmt.Sprintf("Database error: %s", e.Reason)
|
2024-07-19 08:03:35 +00:00
|
|
|
}
|