Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow predicate error messages to be functions #74
The second arg to expound/def could either be a string or a function that is passed the problem (and maybe the spec itself?) and returns an error string. I believe that would allow you to grab any information you’ve added to the problem and would also allow you to include any relevant information (e.g. the range information) in the message.
Use case: spec-tools allows users to add a "reason" to specs https://github.com/metosin/spec-tools/blob/master/README.md#custom-errors