Browse Source

debug: instrument when failed to write the file

Tienson Qin 4 năm trước cách đây
mục cha
commit
f0713086d1
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      src/main/frontend/handler/file.cljs

+ 3 - 0
src/main/frontend/handler/file.cljs

@@ -246,6 +246,9 @@
                                (fs/write-file! repo (config/get-repo-dir repo) path content
                                                {:old-content original-content}))
                              (p/catch (fn [error]
+                                        (state/pub-event! [:instrument {:type :write-file/failed
+                                                                        :payload {:path path
+                                                                                  :error error}}])
                                         (log/error :write-file/failed {:path path
                                                                        :content content
                                                                        :error error}))))))