use object instead of Error for validation errors