diff --git a/internal/utilities/utilities.go b/internal/utilities/utilities.go index 5e71636..5d3766e 100644 --- a/internal/utilities/utilities.go +++ b/internal/utilities/utilities.go @@ -5,7 +5,6 @@ package utilities import ( - "errors" "fmt" "os/exec" "regexp" @@ -17,9 +16,15 @@ func GetFQDN(url string) string { return r.ReplaceAllString(url, "") } +type UnspecifiedProgramError struct{} + +func (e UnspecifiedProgramError) Error() string { + return "the program to view these files is unspecified" +} + func OpenMedia(viewer string, paths []string) error { if viewer == "" { - return errors.New("the image viewer is not specified") + return UnspecifiedProgramError{} } command := exec.Command(viewer, paths...)