Allow a second arity on channel ex-handler which takes val as well as throwable

Description

When a transducer is applied to a channel and an exception occurs during transformation the ex-handler will be called with
the Throwable as an argument.

Can we also send the val which caused the transformation exception to the ex-handler? When dealing with transducer errors it might be useful to have the full picture.

If that's agreeable, and the solution is a second-arity on ex-handler that takes val and throwable, and the call applied is:

clojure.core.async.impl.channels becomes:

Environment

None

Activity

Show:
import
February 23, 2017, 8:41 PM

Comment made by: d-t-w

Perhaps leave the ex-handler as-is, but pass an ex-info rather than simply the caught Throwable. Value that caused the exception provided in the ex-info map, Throwable as cause.

Nivedita Priyadarshini
February 19, 2015, 11:56 AM

Found the same need when using core.async/pipeline in my code. Wrote a patch of sorts (demonstrative) which allows you to have val in the exh for clj. Happy to write a full patch if this looks okay.

Assignee

Unassigned

Reporter

import

Labels

None

Approval

None

Patch

None

Priority

Minor