Introduce ex-message and ex-cause to abstract away the platform in dealing with ExceptionInfo

Description

Add ex-message and ex-cause functions to extract the message and cause exception respectively (similar to ex-data). These were added to ClojureScript in CLJS-429 and having them in Clojure as well makes these functions portable in cross-platform error handling code.

Patch: clj-1120-v2.patch

Screened by: Alex Miller

Environment

None

Activity

Show:
Michał Marczyk
December 6, 2012, 12:23 PM

The attached patch implements ex-message and ex-cause to work on arbitrary Throwables.

Daniel Compton
October 24, 2017, 4:22 AM

This exists in ClojureScript. It would be really useful to have it in Clojure for cross-platform development.

Andy Fingerhut
September 11, 2018, 11:45 PM

Patch clj-1120-v2.patch is identical to Michal's 0001-CLJ-1120-ex-message-ex-cause.patch, except that it changes "added" metadata to Clojure version 1.10, and removes the "Alpha - subject to change" from the doc string, since the corresponding ClojureScript functions seemed to have removed such messages some time ago. Retained attribution and Michal's original patch creation date & time.

Completed

Assignee

Michał Marczyk

Reporter

Michał Marczyk

Labels

Approval

Ok

Patch

Code

Fix versions

Priority

Major
Configure