[spec] Printing of spec problems buries the failing predicate which should be more prominent

Description

After CLJ-2376, you might see an error like this:

user=> (let [a #_1 b 2]) CompilerException clojure.lang.ExceptionInfo: Call to clojure.core/let did not conform to spec: In: [0] val: [a b 2] fails spec: :clojure.core.specs.alpha/bindings at: [:args :bindings] predicate: even-number-of-forms?

This puts the spec (long, not initially relevant) before the predicate which is more important.

1.9 spec problem line format:

[In IN]val: VAL fails[ spec: SPEC][ at:PATH] predicate: PRED[, REASON]

Proposed: Put value and pred first and if there is an internal "reason" that should take precedence.

Proposed format:

VAL failed: [REASON|PRED][ in: IN][ at: PATH][ spec: SPEC]

Example afterwards:

user=> (let [a #_1 b 2]) [a b 2] failed: even-number-of-forms? in: [0] at: [:args :bindings] spec: :clojure.core.specs.alpha/bindings

Patch: clj-2391-3.patch

Environment

None

Attachments

3
  • 29 Aug 2018, 03:09 PM
  • 29 Aug 2018, 12:52 AM
  • 22 Aug 2018, 10:44 PM

Activity

Show:

Alex MillerSeptember 5, 2018 at 1:14 AM

Applied

Alex MillerAugust 29, 2018 at 12:52 AM

Added -2 patch that removes the leading "val:"

Completed

Details

Assignee

Reporter

Approval

Ok

Patch

Code

Priority

Affects versions

Fix versions

Created August 22, 2018 at 10:42 PM
Updated September 5, 2018 at 1:14 AM
Resolved September 5, 2018 at 1:14 AM