Skip to content

Commit 04b489c

Browse files
authored
Merge pull request #153 from clj-commons/hls/20250812-restore-aviso-bridge
Restore and extend the io.aviso.exception and io.aviso.repl shim namespaces
2 parents 29a7e02 + f3ad370 commit 04b489c

File tree

4 files changed

+66
-5
lines changed

4 files changed

+66
-5
lines changed

CHANGES.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
## 3.6.3 -- UNRELEASED
2+
3+
- Restore, at least temporarily, the `io.aviso.exception` and `io.aviso.repl shim` namespaces
4+
- Add a shim for `io.aviso.exception/*traditional*`
5+
6+
[Closed Issues](https://github.com/clj-commons/pretty/milestone/62?closed=1)
7+
18
## 3.6.2 -- 7 Aug 2025
29

3-
- Fix a bug where the horizontal bar for repeated stack frames could be misaligned
10+
- Fix a bug where the vertical bar for repeated stack frames could be misaligned
411
- Hide `clojure.lang.RestFn` stack frames
512

613
[Closed Issues](https://github.com/clj-commons/pretty/milestone/61?closed=1)
@@ -24,7 +31,7 @@ Fix a bug where omitted stack frames were printed.
2431
* `clj-commons.format.table/print-table`
2532
* The :default-decorator option is now deprecated
2633
* New column option :formatter will format a column value to a string or composed string
27-
* New :row-deprecator option decorates all columns of a row
34+
* New :row-decorator option decorates all columns of a row
2835
* Column widths may be calculated even from a composed string
2936
* `clj-commons.format.exceptions`
3037
* Previously, individual stack frames that repeated were identified; Pretty can now identify _sequences_ of repeating

src/clj_commons/format/exceptions.clj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,7 @@
371371

372372
(defn- format-clojure-frame-base
373373
[frame]
374-
(let [{:keys [line]} frame
375-
names' (->> frame
374+
(let [names' (->> frame
376375
:names
377376
counted-terms
378377
(map counted-frame-name))
@@ -401,7 +400,7 @@
401400
402401
Formatting is based on whether the frame is omitted, and whether it is a Clojure or Java frame."
403402
{:added "0.3.0"}
404-
[{:keys [line names] :as frame}]
403+
[{:keys [names] :as frame}]
405404
(cond
406405
(:omitted frame)
407406
(assoc frame

src/io/aviso/exception.clj

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
(ns io.aviso.exception
2+
"A shim in org.clj-commons/pretty to emulate a few key functions from io.aviso/pretty.
3+
4+
This namespace may be deleted in a future release."
5+
{:added "2.5.0"
6+
:deprecated "2.5.0"}
7+
(:require [clj-commons.format.exceptions :as e]))
8+
9+
(defn demangle
10+
[^String s]
11+
(e/demangle s))
12+
13+
(defn format-exception
14+
([exception]
15+
(e/format-exception exception))
16+
([exception options]
17+
(e/format-exception exception options)))
18+
19+
(defn write-exception
20+
([exception]
21+
(e/print-exception exception))
22+
([exception options]
23+
(e/print-exception exception options)))
24+
25+
(def ^:dynamic *default-frame-rules*
26+
"This is provided only to prevent source compilation failures; changing this value does not affect
27+
how the clj-commons.format.exceptions namespace operates."
28+
[])
29+
30+
(def ^:dynamic *fonts*
31+
"This is provided only to prevent source compilation failures; changing this value does not affect
32+
how the clj-commons.format.exceptions namespace operates."
33+
{})
34+
35+
(def ^{:dynamic true
36+
:added "3.6.3"
37+
:deprecated "3.6.3"} *traditional*
38+
"This is provided only to prevent source compilation failures; changing this value does not affect
39+
how the clj-commons.format.exceptions namespace operates."
40+
false)

src/io/aviso/repl.clj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(ns io.aviso.repl
2+
"A shim in org.clj-commons/pretty to emulate a few key functions from io.aviso/pretty.
3+
4+
This namespace may be deleted in a future release."
5+
{:added "2.5.0"
6+
:deprecated "2.5.0"}
7+
(:require [clj-commons.pretty.repl :as repl]))
8+
9+
(defn install-pretty-exceptions
10+
[]
11+
(repl/install-pretty-exceptions))
12+
13+
(defn uncaught-exception-handler
14+
[]
15+
(repl/uncaught-exception-handler))

0 commit comments

Comments
 (0)