C
C#•16mo ago
Obel

ProblemDetails and FluentValidation

Im having issues returning/throwing a custom exception made with ProblemDetails. Im using FluentValidation to validate the input, and then i want to throw the custom exception whenever data isn't valid. I'll attach code snippets of relevant classes. Hopefully some of you, can see through my problem 🙂 Thanks in advance
3 Replies
Obel
ObelOP•16mo ago
As of now i get an Internal server Error when i try to force the error by requesting with bad data I've set up fluent validation using the documentation from here -> https://docs.fluentvalidation.net/en/latest/aspnet.html
Tvde1
Tvde1•16mo ago
usually we return a 400 ourselves and the validationresult
Obel
ObelOP•16mo ago
Yes thank you, i found the solution. And it was exactly this approach! 🙂
Want results from more Discord servers?
Add your server