Add option to define custom error code in ValidationRule