Warren Buckley
08/08/2024, 2:51 PMtryExecuteAndNotify
helper from Umbraco to help me calling my OpenAPI Spec from my generated TS client.
I am trying to return a nice message from my C# Mgmt API Controller in the hope that it gets shown in the error notification but I just get
ApiError
A fatal server error occurred. If this continues, please reach out to your administrator.
Warren Buckley
08/08/2024, 3:06 PMrickbutterfield
08/08/2024, 3:09 PMconst { data, error } = await tryExecuteAndNotify(...
rickbutterfield
08/08/2024, 3:09 PMWarren Buckley
08/08/2024, 3:18 PMWarren Buckley
08/08/2024, 3:18 PMWarren Buckley
08/08/2024, 3:19 PMcsharp
return BadRequest(new Umbraco.Cms.Api.Common.Builders.ProblemDetailsBuilder()
.WithTitle("Try again")
.WithDetail("You didnt say the magic word")
.Build());
I was expecting to just work and show up in the error notification
return BadRequest("You didnt say the magic word");
Warren Buckley
08/08/2024, 3:19 PMWarren Buckley
08/08/2024, 3:20 PMWarren Buckley
08/08/2024, 3:27 PMjson
{
"type": "Error",
"title": "Try again",
"status": 400,
"detail": "You didnt say the magic word"
}
Markus Johansson
08/09/2024, 11:30 AMtryExecute
which does not automatically show any notifications.Warren Buckley
08/09/2024, 11:51 AM