diff --git a/.deadcode-out b/.deadcode-out index 892dd0ca9c..b370a3b02a 100644 --- a/.deadcode-out +++ b/.deadcode-out @@ -201,10 +201,6 @@ code.gitea.io/gitea/modules/setting GitConfigType.GetOption InitLoggersForTest -code.gitea.io/gitea/modules/storage - ErrInvalidConfiguration.Error - IsErrInvalidConfiguration - code.gitea.io/gitea/modules/structs ParseCreateHook ParsePushHook diff --git a/modules/storage/storage.go b/modules/storage/storage.go index d944b8618f..453d755fbb 100644 --- a/modules/storage/storage.go +++ b/modules/storage/storage.go @@ -18,25 +18,6 @@ import ( // ErrURLNotSupported represents url is not supported var ErrURLNotSupported = errors.New("url method not supported") -// ErrInvalidConfiguration is called when there is invalid configuration for a storage -type ErrInvalidConfiguration struct { - cfg any - err error -} - -func (err ErrInvalidConfiguration) Error() string { - if err.err != nil { - return fmt.Sprintf("Invalid Configuration Argument: %v: Error: %v", err.cfg, err.err) - } - return fmt.Sprintf("Invalid Configuration Argument: %v", err.cfg) -} - -// IsErrInvalidConfiguration checks if an error is an ErrInvalidConfiguration -func IsErrInvalidConfiguration(err error) bool { - _, ok := err.(ErrInvalidConfiguration) - return ok -} - type Type = setting.StorageType // NewStorageFunc is a function that creates a storage