🐛 Fix: Error handling code for the makeFolder

The previous code had a condition where it was using the wrong variable, thus was impossible to reach.
This commit is contained in:
James Musselman 2024-06-26 11:49:09 -05:00
parent 68eef8524c
commit 2457ee9836
Signed by: Musselman
GPG key ID: 1DAEFF35ECB5D6DB

View file

@ -82,7 +82,6 @@ func bundleFilesToZip(folderPath string, destination string) error {
return nil return nil
}) })
if err != nil { if err != nil {
log.Printf("Error bundling files to zip: %v", err) log.Printf("Error bundling files to zip: %v", err)
return err return err
@ -123,10 +122,10 @@ func exportFiles(w http.ResponseWriter, r *http.Request) {
// Create a temporary folder to store the exported files // Create a temporary folder to store the exported files
tempFolder := filepath.Join(".", "temp") tempFolder := filepath.Join(".", "temp")
err2 := makeFolder(tempFolder) err = makeFolder(tempFolder)
if err != nil { if err != nil {
http.Error(w, "Error creating temporary folder", http.StatusInternalServerError) http.Error(w, "Error creating temporary folder", http.StatusInternalServerError)
log.Println(err2) log.Println(err)
return return
} }
@ -164,7 +163,6 @@ func exportFiles(w http.ResponseWriter, r *http.Request) {
return nil return nil
}) })
if err != nil { if err != nil {
http.Error(w, "Error converting HTML files to Markdown", http.StatusInternalServerError) http.Error(w, "Error converting HTML files to Markdown", http.StatusInternalServerError)
log.Println(err) log.Println(err)
@ -257,7 +255,6 @@ func copyFolder(source string, destination string) error {
return nil return nil
}) })
if err != nil { if err != nil {
log.Printf("Error copying folder: %v", err) log.Printf("Error copying folder: %v", err)
return err return err