Use structured errors during validation

Will do