fisxoj / sanity-clause

A data serialization/contract library for common lisp
GNU Lesser General Public License v3.0
51 stars 2 forks source link

Improve error messages #9

Open fisxoj opened 5 years ago

fisxoj commented 5 years ago

For example:

A value for field TITLE is required but none was provided.

Would be better as

A value for field TITLE in class INFO-OBJECT is required but none was provided in object
(("version" . "1.0.1") ("license" ("url" . "http://www.apache.org/licenses/LICENSE-2.0.html") ("name" . "Apache 2.0")) ..)

This probably requires making schema objects available to the methods that throw these errors, or catching them and adding context in a higher function like sanity-clause.schema:load.