Skip to content

Commit

Permalink
Change emote dir error to a warning if the path doesn't exist
Browse files Browse the repository at this point in the history
Closes #194
  • Loading branch information
joeyak committed Feb 3, 2023
1 parent e91e4e8 commit adf00fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion emotes.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"errors"
"fmt"
"io/fs"
"os"
Expand All @@ -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
}

Expand Down

0 comments on commit adf00fb

Please sign in to comment.