Implement error-specific exit codes

This commit is contained in:
2024-08-11 20:21:01 -04:00
parent 06b9527a33
commit ed9c4e91ff
18 changed files with 102 additions and 88 deletions
+2 -2
View File
@@ -25,12 +25,12 @@ func WalkEntryDir() ([]string, []string) {
// check for errors encountered while walking directory
if err != nil {
if os.IsNotExist(err) {
fmt.Println(core.AnsiError+"The entry directory does not exist - run \""+os.Args[0], "init"+"\" to create it"+core.AnsiReset)
fmt.Println(core.AnsiError+"The entry directory does not exist - Run \""+os.Args[0], "init"+"\" to create it"+core.AnsiReset)
} else {
// otherwise, print the source of the error
fmt.Println(core.AnsiError + "An unexpected error occurred while generating the entry list: " + err.Error() + core.AnsiReset)
}
os.Exit(1)
os.Exit(111)
}
// trim root path from each path before storing