From adf00fb05d085105125c123e0ab90cc5741cf9a0 Mon Sep 17 00:00:00 2001 From: joeyak Date: Fri, 3 Feb 2023 09:49:25 -0500 Subject: [PATCH] Change emote dir error to a warning if the path doesn't exist Closes #194 --- emotes.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/emotes.go b/emotes.go index e6a0125..29c0170 100644 --- a/emotes.go +++ b/emotes.go @@ -1,6 +1,7 @@ package main import ( + "errors" "fmt" "io/fs" "os" @@ -27,7 +28,11 @@ func processEmoteDir(dir string) (common.EmotesMap, error) { em := make(common.EmotesMap) _, err := os.ReadDir(dir) if err != nil { - common.LogErrorf("could not open emote dir: %v\n", err) + if errors.Is(err, os.ErrNotExist) { + common.LogInfof("%s does not exist so no emotes were loaded\n", dir) + } else { + common.LogErrorf("could not open emote dir: %v\n", err) + } return em, nil }