ex-info thrown inside with-db-transaction is not preserved


  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    Clojure 1.7.0, java.jdbc 0.3.7 (same issue exists in 0.4.2 but my active environment uses 0.3.7)


I have a with-db-transaction block surrounding several queries, where in case one of them fails I would like to attach some locally known metadata about the individual query using ex-info. Unfortunately the* macro uses to strip off all the layers of RuntimeException around a thrown SQLException. Since clojure.lang.ExceptionInfo is a RuntimeException, this means that my metadata does not survive to the outside of the with-db-transaction macro, unless I defeat the intent of JVM exception handling by passing the original SQLException somewhere other than the cause field of my wrapper exception.

  • Is this RuntimeException stripping behavior mentioned in the public facing documentation for
  • Is it feasible from a design point of view to suppress this behavior, either on a switch, or for ExceptionInfo only, or both?

(I am happy to supply a patch myself if you judge this an appropriate enhancement.)


Sean Corfield made changes -
Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]
Sean Corfield made changes -
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Completed [ 1 ]
Sean Corfield made changes -
Status Resolved [ 5 ] Closed [ 6 ]


Vote (0)
Watch (0)


  • Created: