diff --git a/service/profile/api.go b/service/profile/api.go index b7fa8079f..048348562 100644 --- a/service/profile/api.go +++ b/service/profile/api.go @@ -103,7 +103,7 @@ func handleGetProfileIcon(ar *api.Request) (data []byte, err error) { switch { case err == nil: // Continue - case errors.Is(err, binmeta.IconIgnored): + case errors.Is(err, binmeta.ErrIconIgnored): return nil, api.ErrorWithStatus(err, http.StatusNotFound) default: return nil, err diff --git a/service/profile/binmeta/icons.go b/service/profile/binmeta/icons.go index 04a8bcb2d..3abe6ce85 100644 --- a/service/profile/binmeta/icons.go +++ b/service/profile/binmeta/icons.go @@ -19,8 +19,8 @@ import ( // Must not be changed once set. var ProfileIconStoragePath = "" -// IconIgnored is returned when the icon should be ignored. -var IconIgnored = errors.New("icon is ignored") +// ErrIconIgnored is returned when the icon should be ignored. +var ErrIconIgnored = errors.New("icon is ignored") // GetProfileIcon returns the profile icon with the given ID and extension. func GetProfileIcon(name string) (data []byte, err error) { @@ -31,7 +31,7 @@ func GetProfileIcon(name string) (data []byte, err error) { // Check if icon should be ignored. if IgnoreIcon(name) { - return nil, IconIgnored + return nil, ErrIconIgnored } // Build storage path. @@ -69,7 +69,7 @@ func UpdateProfileIcon(data []byte, ext string) (filename string, err error) { // Check if icon should be ignored. if IgnoreIcon(sum) { - return "", IconIgnored + return "", ErrIconIgnored } // Check ext.