Browse Source

fix(persist-var): do nothing if file not found, dont log error

rcmerci 3 years ago
parent
commit
26de896afe
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/main/frontend/util/persist_var.cljs

+ 5 - 3
src/main/frontend/util/persist_var.cljs

@@ -28,9 +28,11 @@
   ILoad
   (-load [_]
     (let [repo (state/get-current-repo)]
-      (p/let [content (fs/read-file
-                       (config/get-repo-dir (state/get-current-repo))
-                       (load-path location))]
+      (p/let [content (p/catch
+                          (fs/read-file
+                           (config/get-repo-dir (state/get-current-repo))
+                           (load-path location))
+                          (constantly nil))]
         (when-let [content (and (some? content)
                                 (try (cljs.reader/read-string content)
                                      (catch js/Error e