Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch and ignore the Exception from ValidationAttributeHelper. #17423

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

maliming
Copy link
Member

@maliming maliming commented Aug 21, 2023

Fix #17379

We cannot ensure that the attribute used by customers is legal, we just simply catch it.

The following combinations are illegal and throw InvalidOperationException:
 1) Both ErrorMessage and ErrorMessageResourceName are set
 2) None of ErrorMessage, ErrorMessageResourceName, and DefaultErrorMessage are set.
 3) Must set both or neither of ErrorMessageResourceType and ErrorMessageResourceName

@maliming maliming added this to the 8.0-preview milestone Aug 21, 2023
@maliming maliming changed the title Skip to set the ErrorMessage of ValidationAttribute for some cases. Catch and ignore the Exception from ValidationAttributeHelper. Aug 21, 2023
@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Merging #17423 (07ec945) into dev (9bebe77) will decrease coverage by 0.01%.
Report is 4 commits behind head on dev.
The diff coverage is 70.00%.

@@            Coverage Diff             @@
##              dev   #17423      +/-   ##
==========================================
- Coverage   53.30%   53.30%   -0.01%     
==========================================
  Files        3022     3022              
  Lines       94216    94221       +5     
==========================================
+ Hits        50223    50225       +2     
- Misses      43993    43996       +3     
Files Changed Coverage Δ
...etCore/Mvc/Validation/ValidationAttributeHelper.cs 81.81% <66.66%> (-12.30%) ⬇️
.../ModelBinding/Metadata/AbpModelMetadataProvider.cs 88.46% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@realLiangshiwei realLiangshiwei merged commit ed6d9f4 into dev Aug 21, 2023
3 of 4 checks passed
@realLiangshiwei realLiangshiwei deleted the ValidationAttributeHelper branch August 21, 2023 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants