Skip to content

Commit 140b4c1

Browse files
authored
Handle unloadable classes (#10)
Fixes #9
1 parent c24fa0b commit 140b4c1

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## master (unreleased)
44

5+
### Bugs fixed
6+
7+
* [#9](https://github.com/clojure-emacs/haystack/issues/9): handle unloadable classes.
8+
9+
## 0.0.3
10+
511
### Changes
612

713
* Add stacktrace analyzer and parsers.

src/haystack/analyzer.clj

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,16 @@
8787
path->url
8888
str)
8989
(str (frame->url frame)))))
90-
(assoc frame :file-url (some->> frame :name symbol
91-
(java/resolve-symbol 'user)
92-
:file
93-
path->url
94-
str))))
90+
(assoc frame :file-url (try
91+
(some->> frame :name symbol
92+
(java/resolve-symbol 'user)
93+
:file
94+
path->url
95+
str)
96+
(catch Throwable _
97+
;; `java/resolve-symbol` can throw exceptions when the underlying class cannot be loaded.
98+
;; See https://github.com/clojure-emacs/haystack/issues/9
99+
nil)))))
95100

96101
(defn- analyze-file
97102
"Associate the file type (extension) of the source file to the frame map, and

0 commit comments

Comments
 (0)