Currently, Expound primarily returns error messages as plain strings via expound-str. Because the error messages are strings, users attempting to programmatically manipulate them (e.g., to shrink the context, hide irrelevant data, or inject custom information) must rely on brittle and error-prone string parsing.
Expound error messages work by displaying a "problem" value within its surrounding "context" value. For example, if a value in a map is invalid, Expound prints the entire map (the context) and uses carets (^^^^^) to point to the specific invalid value (the problem).
Common pain points include:
- Large Contexts: Very large or deeply nested maps/sequences make error messages difficult to read.
- Long Sequences: Long sequences often use
... to truncate, which can be improved with more descriptive summaries (e.g., < 7 more >). - Irrelevant Data: In complex structures, much of the printed context might not be relevant to why the predicate failed.
- Lack of Customization: There is currently no standard way to inject additional metadata or prevent specific large records from being printed in their entirety.