feat: pass validation info to error handlers

This patch adds the ability to pass validation failure information to
the error handlers. This enables more robust error handling that allows
an error handler to return fine-grained error messages based on the
validation failure.

Closes #7