0
0
mirror of https://dev.sigpipe.me/dashie/git.txt synced 2025-10-06 06:02:41 +02:00
Files
git.txt/models/errors/repo.go

22 lines
398 B
Go

package errors
import "fmt"
// RepoNotExist struct
type RepoNotExist struct {
ID int64
UserID int64
Name string
}
// IsRepoNotExist func
func IsRepoNotExist(err error) bool {
_, ok := err.(RepoNotExist)
return ok
}
// Error func
func (err RepoNotExist) Error() string {
return fmt.Sprintf("repository does not exist [id: %d, user_id: %d, name: %s]", err.ID, err.UserID, err.Name)
}