0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00

Add better reporting for s3 storage backend errors

This commit is contained in:
Andrey Antukh 2024-10-25 16:11:20 +02:00
parent 5b860ee601
commit fe83c5faea

View file

@ -142,6 +142,8 @@
(ex/raise :type :not-found (ex/raise :type :not-found
:code :object-not-found :code :object-not-found
:hint "s3 object not found" :hint "s3 object not found"
:object-id (:id object)
:object-path (impl/id->path (:id object))
:cause result) :cause result)
(and (ex/instance? java.nio.file.FileAlreadyExistsException result) (and (ex/instance? java.nio.file.FileAlreadyExistsException result)
@ -242,10 +244,12 @@
{:name "penpot/s3/uploader" {:name "penpot/s3/uploader"
:virtual true :virtual true
:daemon true} :daemon true}
(l/trace :hint "start upload thread" (l/debug :hint "start upload thread"
:object-id (str id) :object-id (str id)
:size (impl/get-size content) :size (impl/get-size content)
::l/sync? true) ::l/sync? true)
;; FIXME: improve buffer reusing
(let [stream (io/input-stream content) (let [stream (io/input-stream content)
bsize (* 1024 64) bsize (* 1024 64)
tpoint (dt/tpoint)] tpoint (dt/tpoint)]