Skip to content

Instantly share code, notes, and snippets.

View karolinepauls's full-sized avatar
🇪🇺

Karoline Pauls karolinepauls

🇪🇺
View GitHub Profile
@karolinepauls
karolinepauls / INFO.md
Last active January 16, 2022 23:56
clojure.main/report-error pprint problem report and patch drafts

The problem reproduced here occurs when an exception is thrown from user code and reaches clojure.main code responsible for exception reporting. Due to the use of pprint, reporting code can fail, obscuring the error and printing a rather unexpected Java stack trace, which is probably most obscure in case of StackOverflow.

The root cause is potentially buggy ex-info (ex-data with values having broken pprint methods or reference cycles, like overtone/at-at#20) being passed to Throwable->map in clojure.main/report-error. Throwable->map itself calls ex-data in a couple of places.

The "less simple" of the attached patches replaces :clojure.main/trace (the result of Throwable->map) in the report, however an even more advanced one would be able to replace ex-data everywhere in :clojure.main/trace where it can occur.

Being able to narrow down which part of the rep

apiVersion: apps/v1
kind: Deployment
metadata:
name: some-deployment
labels:
app: some-app
spec:
replicas: 1
selector:
matchLabels: