Skip to content

Exception data is not pretty printed anymore #3804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rrudakov opened this issue Apr 7, 2025 · 9 comments
Closed

Exception data is not pretty printed anymore #3804

rrudakov opened this issue Apr 7, 2025 · 9 comments
Assignees

Comments

@rrudakov
Copy link
Contributor

rrudakov commented Apr 7, 2025

Expected behavior

Exception data is pretty printed in *cider-error* buffer. Example from CIDER 1.17.1:

Image

Actual behavior

Exception data is printed in one line and truncated. Example from CIDER 1 .18-SNAPSHOT:

Image

the data is truncated and there is no way to see the full map:

Image

Steps to reproduce the problem

Evaluate a for that throws an exception with a big ex-data map. For example:

(throw (ex-info "The error with a very big data"
                  {:user-id 12345
                   :username "john.doe"
                   :email "[email protected]"
                   :profile {:first-name "John"
                             :last-name "Doe"
                             :age 30
                             :address {:street "123 Main St"
                                       :city "Anytown"
                                       :zip "12345"}
                             :interests ["programming" "hiking" "reading"]}
                   :orders [{:order-id 1001 :items ["book" "pen"] :total 25.00}
                            {:order-id 1002 :items ["laptop"] :total 1200.00}]
                   :active? true
                   :created-at #inst "2023-10-27T10:00:00.000-00:00"
                   :settings {:theme "dark", :notifications true}}))

Environment & Version information

CIDER version information

;; CIDER 1.18.0-snapshot (package: 20250407.822), nREPL 1.3.1
;; Clojure 1.12.0, Java 23.0.2

Lein / Clojure CLI version

Clojure CLI 1.12

Emacs version

GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.3.0, NS appkit-2575.40 Version 15.3.2 (Build 24D81)) of 2025-04-03

Operating system

MacOS

@bbatsov
Copy link
Member

bbatsov commented Apr 7, 2025

@alexander-yakushev Would you mind taking a look?

@alexander-yakushev
Copy link
Member

Hi, this is intentional as of #3790. Instead of pretty-printing the stacktrace, it is expected that the user clicks the exception to open it (together with its data) in the inspector. We're still lacking a good way to hint the user this is possible – that's what needs to be fixed indeed.

@rrudakov
Copy link
Contributor Author

rrudakov commented Apr 7, 2025

@alexander-yakushev how should I click to open the inspector? I tried with mouse and I tried using RET key, but nothing happens. In the echo area I see the message Buffer is read-only: #<buffer *cider-error*>

@alexander-yakushev
Copy link
Member

It works by clicking on the exception class.

Image

Very obscure, I know.

@rrudakov
Copy link
Contributor Author

rrudakov commented Apr 7, 2025

Indeed, it works, thanks! For the record, it's bound to i key if one wants to use keyboard :)

Not sure if I should close this issue.

@bbatsov
Copy link
Member

bbatsov commented Apr 7, 2025

Probably we should insert some button after it or under it.

@bbatsov
Copy link
Member

bbatsov commented Apr 7, 2025

Not sure if I should close this issue.

Let's keep it open for now, as admittedly the UI is confusing right now and we'll need to improve it a bit, before cutting the next CIDER release.

@alexander-yakushev
Copy link
Member

Can be closed now as addressed by #3807.

@bbatsov bbatsov closed this as completed Apr 14, 2025
@rrudakov
Copy link
Contributor Author

Thank you @alexander-yakushev!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants