@Markus Johansson or @Kevin Jump you got this working at all for you ?
Warren Buckley
12/06/2024, 12:32 PM
OK its because my error is not an APIError which is determined if the error contains a name prop.
For now I will just handle this myself manually, but a shame not to use the stuff already built into the CMS :S
m
Markus Johansson
12/09/2024, 9:18 AM
@Warren Buckley I've been hitting the same issue, it would be nice if tryExecuteAndNotify would show the error if it was just a 400 (or any other error-isch code) with a string in the body.
I ended up using the built-in ProblemDetailsBuilder in a controller base class when returning errors.
Similar to this
Copy code
var problemDetails = new ProblemDetailsBuilder()
.WithTitle("Error")
.WithDetail(errorBody.Message)
.Build();
return StatusCode(400,problemDetails);