From 2457ee9836d2e4bbea150f753041b502ae93778f Mon Sep 17 00:00:00 2001 From: Musselman Date: Wed, 26 Jun 2024 11:49:09 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix:=20Error=20handling=20code?= =?UTF-8?q?=20for=20the=20makeFolder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous code had a condition where it was using the wrong variable, thus was impossible to reach. --- export.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/export.go b/export.go index de44ba9..5666390 100644 --- a/export.go +++ b/export.go @@ -82,7 +82,6 @@ func bundleFilesToZip(folderPath string, destination string) error { return nil }) - if err != nil { log.Printf("Error bundling files to zip: %v", err) return err @@ -123,10 +122,10 @@ func exportFiles(w http.ResponseWriter, r *http.Request) { // Create a temporary folder to store the exported files tempFolder := filepath.Join(".", "temp") - err2 := makeFolder(tempFolder) + err = makeFolder(tempFolder) if err != nil { http.Error(w, "Error creating temporary folder", http.StatusInternalServerError) - log.Println(err2) + log.Println(err) return } @@ -164,7 +163,6 @@ func exportFiles(w http.ResponseWriter, r *http.Request) { return nil }) - if err != nil { http.Error(w, "Error converting HTML files to Markdown", http.StatusInternalServerError) log.Println(err) @@ -257,7 +255,6 @@ func copyFolder(source string, destination string) error { return nil }) - if err != nil { log.Printf("Error copying folder: %v", err) return err