Explorar o código

change status handle to new style

Yoginth %!s(int64=7) %!d(string=hai) anos
pai
achega
05cb5cff62
Modificáronse 1 ficheiros con 17 adicións e 0 borrados
  1. 17 0
      models/errors/org.go

+ 17 - 0
models/errors/org.go

@@ -0,0 +1,17 @@
+package errors
+
+import "fmt"
+
+type TeamNotExist struct {
+	TeamID int64
+	Name   string
+}
+
+func IsTeamNotExist(err error) bool {
+	_, ok := err.(TeamNotExist)
+	return ok
+}
+
+func (err TeamNotExist) Error() string {
+	return fmt.Sprintf("team does not exist [team_id: %d, name: %s]", err.TeamID, err.Name)
+}