Provide more details on validation errors

New class provides attributes `fieldname` and `value` so callers
can get more information about the failure than just a textual
description.