Skip to content

Commit

Permalink
Handle <init> as a method name when parsing an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
hlship committed Feb 10, 2016
1 parent d2e652f commit 95fa087
Show file tree
Hide file tree
Showing 4 changed files with 294 additions and 59 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 0.1.23 - UNRELEASED

`parse-exception` can now handle method names containing '<' and '>' (used for instance and class
constructor methods), as well as other cases from real-life stack traces.

## 0.1.22 - 5 Feb 2016

Fixed a bug where `parse-exception` would fail if the source was "Unknown Source" instead
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject io.aviso/pretty "0.1.22"
(defproject io.aviso/pretty "0.1.23"
:description "Clojure library to help print things, prettily"
:url "https://github.com/AvisoNovate/pretty"
:license {:name "Apache Sofware License 2.0"
Expand Down
4 changes: 2 additions & 2 deletions src/io/aviso/exception.clj
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@

(def ^:private re-stack-frame
;; Sometimes the file name and line number are replaced with "Unknown source"
#"\s+at ([a-zA-Z_.$\d]+)\(((.+):(\d+))?.*\).*"
#"\s+at ([a-zA-Z_.$\d<>]+)\(((.+):(\d+))?.*\).*"
; Group 1 - class and method name
; Group 3 - file name (or nil)
; Group 4 - line number (or nil)
Expand Down Expand Up @@ -723,7 +723,7 @@
[])))

:skip-more-line
(if (re-matches #"\s+\.\.\. \d+ more" line)
(if (re-matches #"\s+\.\.\. \d+ (more|common frames omitted)" line)
(recur :start more-lines
exceptions stack-trace stack-trace-batch)
(recur :start lines
Expand Down

0 comments on commit 95fa087

Please sign in to comment.