From 3f667afb355f9694932fb6e5756268369ba50770 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Wed, 5 Feb 2020 18:21:02 +0000 Subject: [PATCH] #44: fixed --- src/smeagol/routes/wiki.clj | 2 +- src/smeagol/uploads.clj | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/smeagol/routes/wiki.clj b/src/smeagol/routes/wiki.clj index b455d78..72df1af 100644 --- a/src/smeagol/routes/wiki.clj +++ b/src/smeagol/routes/wiki.clj @@ -165,7 +165,7 @@ "Render a form to allow the upload of a file." [request] (let [params (keywordize-keys (:params request)) - data-path (str util/content-dir "/content/uploads/") + data-path (str util/content-dir "/uploads/") git-repo (hist/load-or-init-repo util/content-dir) upload (:upload params) uploaded (if upload (ul/store-upload params data-path)) diff --git a/src/smeagol/uploads.clj b/src/smeagol/uploads.clj index cdac04a..7fd8c18 100644 --- a/src/smeagol/uploads.clj +++ b/src/smeagol/uploads.clj @@ -59,8 +59,12 @@ (timbre/debug (str "store-upload mv file: " tmp-file " to: " path filename)) (if tmp-file - (do - (.renameTo tmp-file - (File. (str path filename))) - filename) + (try + (do + (.renameTo tmp-file + (File. (str path filename))) + filename) + (catch Exception x + (timbre/error (str "Failed to move " tmp-file " to " path filename "; " (type x) ": " (.getMessage x))) + (throw x))) (throw (Exception. "No file found?")))))