           (ex-info (str "Couldn't read the file:" f)
                    {::error true} t)))))
 
+(defn read-edn-string [s & [fail-msg]]
+  (try
+    (edn/read-string s)
+    (catch Throwable e
+      (throw (ex-info (str
+                       (.getMessage e) "\n"
+                       (or fail-msg "Failed to read EDN string: ")
+                       (pr-str s))
+                      {::error true}
+                      e)))))
+
 (defn read-edn-opts [str]
   (letfn [(read-rsrc [rsrc-str orig-str]
             (if-let [rsrc (io/resource rsrc-str)]
-              (edn/read-string (slurp rsrc))
+              (read-edn-string (slurp rsrc))
               (cljs.cli/missing-resource orig-str)))]
     (cond
      (string/starts-with? str "@/") (read-rsrc (subs str 2) str)

          {:group :cljs.cli/compile :fn figwheel-opts-opt
           :arg "edn"
           :doc (str "Options to configure figwheel.main, can be an EDN string or "
                     "system-dependent path-separated list of EDN files / classpath resources. Options "
                     "will be merged left to right.")}
          ;; TODO uncertain about this

          (println (.getMessage e))
          (throw e))))))


))

#_(def test-args
