diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-04-17 10:14:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-17 10:14:18 +0800 |
commit | fa497b16332c24bc4d9e788c64bda94e3c1499a7 (patch) | |
tree | 1dcf1b13f702a07dc30da791bf0e76e1ffba4027 /internal/db/error.go | |
parent | e131a4564680a3257a2d4795af7669e4260b33b9 (diff) |
db: add tests for repos (#6112)
* Add Repos.create method
* Fix repo name error handling
* Fix all compile errors
* Update github.com/go-macaron/captcha to fix http issue
* Add repos tests
Diffstat (limited to 'internal/db/error.go')
-rw-r--r-- | internal/db/error.go | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/internal/db/error.go b/internal/db/error.go index 46e7dde5..ba07ca87 100644 --- a/internal/db/error.go +++ b/internal/db/error.go @@ -8,32 +8,6 @@ import ( "fmt" ) -type ErrNameReserved struct { - Name string -} - -func IsErrNameReserved(err error) bool { - _, ok := err.(ErrNameReserved) - return ok -} - -func (err ErrNameReserved) Error() string { - return fmt.Sprintf("name is reserved [name: %s]", err.Name) -} - -type ErrNamePatternNotAllowed struct { - Pattern string -} - -func IsErrNamePatternNotAllowed(err error) bool { - _, ok := err.(ErrNamePatternNotAllowed) - return ok -} - -func (err ErrNamePatternNotAllowed) Error() string { - return fmt.Sprintf("name pattern is not allowed [pattern: %s]", err.Pattern) -} - // ____ ___ // | | \______ ___________ // | | / ___// __ \_ __ \ @@ -245,20 +219,6 @@ func (err ErrLastOrgOwner) Error() string { // |____|_ /\___ > __/ \____/____ >__||__| \____/|__| / ____| // \/ \/|__| \/ \/ -type ErrRepoAlreadyExist struct { - Uname string - Name string -} - -func IsErrRepoAlreadyExist(err error) bool { - _, ok := err.(ErrRepoAlreadyExist) - return ok -} - -func (err ErrRepoAlreadyExist) Error() string { - return fmt.Sprintf("repository already exists [uname: %s, name: %s]", err.Uname, err.Name) -} - type ErrInvalidCloneAddr struct { IsURLError bool IsInvalidPath bool |