@@ -12,66 +12,6 @@ import (
1212 "code.gitea.io/gitea/modules/util"
1313)
1414
15- // ErrUserOwnRepos represents a "UserOwnRepos" kind of error.
16- type ErrUserOwnRepos struct {
17- UID int64
18- }
19-
20- // IsErrUserOwnRepos checks if an error is a ErrUserOwnRepos.
21- func IsErrUserOwnRepos (err error ) bool {
22- _ , ok := err .(ErrUserOwnRepos )
23- return ok
24- }
25-
26- func (err ErrUserOwnRepos ) Error () string {
27- return fmt .Sprintf ("user still has ownership of repositories [uid: %d]" , err .UID )
28- }
29-
30- // ErrUserHasOrgs represents a "UserHasOrgs" kind of error.
31- type ErrUserHasOrgs struct {
32- UID int64
33- }
34-
35- // IsErrUserHasOrgs checks if an error is a ErrUserHasOrgs.
36- func IsErrUserHasOrgs (err error ) bool {
37- _ , ok := err .(ErrUserHasOrgs )
38- return ok
39- }
40-
41- func (err ErrUserHasOrgs ) Error () string {
42- return fmt .Sprintf ("user still has membership of organizations [uid: %d]" , err .UID )
43- }
44-
45- // ErrUserOwnPackages notifies that the user (still) owns the packages.
46- type ErrUserOwnPackages struct {
47- UID int64
48- }
49-
50- // IsErrUserOwnPackages checks if an error is an ErrUserOwnPackages.
51- func IsErrUserOwnPackages (err error ) bool {
52- _ , ok := err .(ErrUserOwnPackages )
53- return ok
54- }
55-
56- func (err ErrUserOwnPackages ) Error () string {
57- return fmt .Sprintf ("user still has ownership of packages [uid: %d]" , err .UID )
58- }
59-
60- // ErrDeleteLastAdminUser represents a "DeleteLastAdminUser" kind of error.
61- type ErrDeleteLastAdminUser struct {
62- UID int64
63- }
64-
65- // IsErrDeleteLastAdminUser checks if an error is a ErrDeleteLastAdminUser.
66- func IsErrDeleteLastAdminUser (err error ) bool {
67- _ , ok := err .(ErrDeleteLastAdminUser )
68- return ok
69- }
70-
71- func (err ErrDeleteLastAdminUser ) Error () string {
72- return fmt .Sprintf ("can not delete the last admin user [uid: %d]" , err .UID )
73- }
74-
7515// ErrInvalidCloneAddr represents a "InvalidCloneAddr" kind of error.
7616type ErrInvalidCloneAddr struct {
7717 Host string
@@ -205,25 +145,6 @@ func (err ErrRepoFileDoesNotExist) Unwrap() error {
205145 return util .ErrNotExist
206146}
207147
208- // ErrFilenameInvalid represents a "FilenameInvalid" kind of error.
209- type ErrFilenameInvalid struct {
210- Path string
211- }
212-
213- // IsErrFilenameInvalid checks if an error is an ErrFilenameInvalid.
214- func IsErrFilenameInvalid (err error ) bool {
215- _ , ok := err .(ErrFilenameInvalid )
216- return ok
217- }
218-
219- func (err ErrFilenameInvalid ) Error () string {
220- return fmt .Sprintf ("path contains a malformed path component [path: %s]" , err .Path )
221- }
222-
223- func (err ErrFilenameInvalid ) Unwrap () error {
224- return util .ErrInvalidArgument
225- }
226-
227148// ErrUserCannotCommit represents "UserCannotCommit" kind of error.
228149type ErrUserCannotCommit struct {
229150 UserName string
0 commit comments