Prepare code for more versions of errors/validation errors

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
Add additional tests for validation errors

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>