mirror of
https://github.com/safing/portmaster
synced 2025-09-04 19:49:15 +00:00
Fix error naming
This commit is contained in:
parent
a457ac4245
commit
cdabffafcd
3 changed files with 6 additions and 6 deletions
|
@ -103,7 +103,7 @@ func handleGetProfileIcon(ar *api.Request) (data []byte, err error) {
|
||||||
switch {
|
switch {
|
||||||
case err == nil:
|
case err == nil:
|
||||||
// Continue
|
// Continue
|
||||||
case errors.Is(err, binmeta.IconIgnored):
|
case errors.Is(err, binmeta.ErrIconIgnored):
|
||||||
return nil, api.ErrorWithStatus(err, http.StatusNotFound)
|
return nil, api.ErrorWithStatus(err, http.StatusNotFound)
|
||||||
default:
|
default:
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -19,8 +19,8 @@ import (
|
||||||
// Must not be changed once set.
|
// Must not be changed once set.
|
||||||
var ProfileIconStoragePath = ""
|
var ProfileIconStoragePath = ""
|
||||||
|
|
||||||
// IconIgnored is returned when the icon should be ignored.
|
// ErrIconIgnored is returned when the icon should be ignored.
|
||||||
var IconIgnored = errors.New("icon is ignored")
|
var ErrIconIgnored = errors.New("icon is ignored")
|
||||||
|
|
||||||
// GetProfileIcon returns the profile icon with the given ID and extension.
|
// GetProfileIcon returns the profile icon with the given ID and extension.
|
||||||
func GetProfileIcon(name string) (data []byte, err error) {
|
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.
|
// Check if icon should be ignored.
|
||||||
if IgnoreIcon(name) {
|
if IgnoreIcon(name) {
|
||||||
return nil, IconIgnored
|
return nil, ErrIconIgnored
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build storage path.
|
// Build storage path.
|
||||||
|
@ -69,7 +69,7 @@ func UpdateProfileIcon(data []byte, ext string) (filename string, err error) {
|
||||||
|
|
||||||
// Check if icon should be ignored.
|
// Check if icon should be ignored.
|
||||||
if IgnoreIcon(sum) {
|
if IgnoreIcon(sum) {
|
||||||
return "", IconIgnored
|
return "", ErrIconIgnored
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check ext.
|
// Check ext.
|
||||||
|
|
|
@ -518,7 +518,7 @@ func (profile *Profile) updateMetadataFromSystem(ctx context.Context, md Matchin
|
||||||
switch {
|
switch {
|
||||||
case err == nil:
|
case err == nil:
|
||||||
// Continue
|
// Continue
|
||||||
case errors.Is(err, binmeta.IconIgnored):
|
case errors.Is(err, binmeta.ErrIconIgnored):
|
||||||
newIcon = nil
|
newIcon = nil
|
||||||
// Continue
|
// Continue
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Reference in a new issue