File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 372372 default )))
373373
374374(defn file-and-line [exception depth]
375- (let [stack (.-stack exception)]
376- (if (and stack (string? stack))
377- ; ; TODO: flesh out
378- (let [stacktrace
379- (vec (map string/trim
380- (string/split stack #"\n " )))
381- stack-element (nth stacktrace depth)
382- fname (js-filename stack-element)
383- [line column] (js-line-and-column stack-element)
384- [fname line column] (mapped-line-and-column fname line column)]
385- {:file fname :line line :column column})
386- {:file (.-fileName exception)
387- :line (.-lineNumber exception)})) )
375+ ; ; TODO: flesh out
376+ (if-let [stack-element (and (string? (.-stack exception))
377+ (some-> (.-stack exception)
378+ string/split-lines
379+ (get depth)
380+ string/trim))]
381+ (let [fname (js-filename stack-element)
382+ [line column] (js-line-and-column stack-element)
383+ [fname line column] (mapped-line-and-column fname line column)]
384+ {:file fname :line line :column column})
385+ {:file (.-fileName exception)
386+ :line (.-lineNumber exception)}))
388387
389388(defn do-report [m]
390389 (let [m (case (:type m)
You can’t perform that action at this time.
0 commit comments