[spec] instrument exception doesn't contain function name in ex-data

Description

When an instrumented function fails, it throws an IExceptionInfo. The ex-data of this exception contains the arguments that failed, but not the function that was called.

*Proposed: Add an extra key clojure.spec.alpha/fn that has the symbol of the var under instrumentation.

After:

Patch: clj2166.patch

Screened by: Alex Miller

Environment

None

Attachments

1

Activity

Alex Miller 
June 26, 2018 at 5:16 PM

Applied

Alex Miller 
June 24, 2017 at 1:29 PM

Thanks, looks good. I've also added the groups for you to have edit rights.

Josh Jones 
June 24, 2017 at 12:22 AM

I've attached a one-liner patch, and welcome any comments or issues.

Note that although I signed the CA today (Rich also signed) and can thus officially submit, I am not yet on "Signed Contributor Agreement" list at https://clojure.org/community/contributors . I can't edit posts on Jira yet, which I why I did not edit to mark that a patch is present.

I've read the contrib guide but this is my first clojure patch, so please bear with me if I have made any errors in the workflow or otherwise here. Thanks!

Using the example in the original ticket, the new output of ex-data is:

Alex Miller 
June 23, 2017 at 10:29 PM

Symbol

Josh Jones 
June 23, 2017 at 9:58 PM

I've done a small patch to add this, but is there a consensus on whether the value for the newly-added key should be the var itself (referenced by a :clojure.spec.alpha/var key), or the symbol (referenced by a :clojure.spec.alpha/fn key)?

Completed

Details

Assignee

Reporter

Labels

Approval

Patch

Priority

Affects versions

Fix versions

Created May 24, 2017 at 5:03 PM
Updated June 26, 2018 at 5:16 PM
Resolved June 26, 2018 at 5:16 PM