From 6558c0eab6f21852d78d69efe22013e3c943c417 Mon Sep 17 00:00:00 2001 From: Logan Fick Date: Fri, 5 Jul 2024 20:16:22 -0400 Subject: [PATCH] Modified errors in directory cleanup function to provide more information. --- utils/utils.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/utils.go b/utils/utils.go index 1635dab73..ee2940bf7 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -307,16 +307,16 @@ func VerifyFFMpegPath(path string) error { func CleanupDirectory(path string) { log.Traceln("Cleaning", path) if err := os.MkdirAll(path, 0o750); err != nil { - log.Fatalln("Unable to create directory. Please check the ownership and permissions", err) + log.Fatalf("Unable to create '%s'. Please check the ownership and permissions: %s\n", path, err) } entries, err := ioutil.ReadDir(path) if err != nil { - log.Fatalln("Unable to read contents of directory. Please check the ownership and permissions", err) + log.Fatalf("Unable to read contents of '%s'. Please check the ownership and permissions: %s\n", path, err) } for _, entry := range entries { entryPath := filepath.Join(path, entry.Name()) if err := os.RemoveAll(entryPath); err != nil { - log.Fatalln("Unable to remove directory. Please check the ownership and permissions", err) + log.Fatalf("Unable to remove file or directory contained in '%s'. Please check the ownership and permissions: %s\n", path, err) } } }