Skip to content

Commit f4aae69

Browse files
[stacktrace] Stop sending compile-like flag
1 parent 0d9ac85 commit f4aae69

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

src/orchard/stacktrace.clj

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,6 @@
253253
(flag-duplicates)
254254
(flag-tooling))))
255255

256-
(defn- compile-like-exception?
257-
"'Compile-like' exceptions are those that happen at runtime (and therefore never
258-
include a `:phase`) which however, represent code that cannot possibly work,
259-
and thus are a compile-like exception (i.e. a linter could have caught them)."
260-
[{:keys [phase type message]}]
261-
(boolean
262-
(and (nil? phase)
263-
(= type 'java.lang.IllegalArgumentException)
264-
(some->> message (re-find #"^No matching (field|method)")))))
265-
266256
(defn- analyze-cause
267257
"Analyze the `cause-data` of an exception, in `Throwable->map` format."
268258
[cause-data print-fn]
@@ -272,7 +262,6 @@
272262
phase (-> cause-data :data :clojure.error/phase)
273263
m {:class (name (:type cause-data))
274264
:phase phase
275-
:compile-like (str (compile-like-exception? cause-data))
276265
:message (:message cause-data)
277266
:stacktrace (analyze-stacktrace-data
278267
(cond (seq (:trace cause-data)) (:trace cause-data)

test/orchard/stacktrace_test.clj

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -256,24 +256,7 @@
256256

257257
(testing "Does not include `:phase` for vanilla runtime exceptions"
258258
(is (match? [{:phase nil}]
259-
(catch-and-analyze (throw (ex-info "" {}))))))
260-
261-
(testing "`:compile-like`"
262-
(testing "For non-existing fields"
263-
(is (match? [{:compile-like "true"}]
264-
(catch-and-analyze (eval '(.-foo ""))))))
265-
(testing "For non-existing methods"
266-
(is (match? [{:compile-like "true"}]
267-
(catch-and-analyze (eval '(-> "" (.foo 1 2)))))))
268-
(testing "For vanilla exceptions"
269-
(is (match? [{:compile-like "false"}]
270-
(catch-and-analyze (throw (ex-info "." {}))))))
271-
(testing "For vanilla `IllegalArgumentException`s"
272-
(is (match? [{:compile-like "false"}]
273-
(catch-and-analyze (throw (IllegalArgumentException. "foo"))))))
274-
(testing "For exceptions with a `:phase`"
275-
(is (match? [{:compile-like "false"} {:compile-like "false"}]
276-
(catch-and-analyze (eval '(let [1]))))))))
259+
(catch-and-analyze (throw (ex-info "" {})))))))
277260

278261
(deftest tooling-frame-name?
279262
(are [frame-name] (true? (#'sut/tooling-frame-name? frame-name))

0 commit comments

Comments
 (0)