Added connection exception handling to node status and added error detail view in node overview

This commit is contained in:
Masu-Baumgartner
2024-09-11 17:04:00 +02:00
parent 9d9f24a21d
commit 80290564d0
2 changed files with 29 additions and 3 deletions

View File

@@ -59,7 +59,20 @@ public class NodesController : BaseCrudController<Node, DetailNodeResponse, Crea
using var httpClient = node.CreateClient();
var response = await httpClient.GetJson<SystemInfoResponse>("system/info");
SystemInfoResponse response;
try
{
response = await httpClient.GetJson<SystemInfoResponse>("system/info");
}
catch (HttpRequestException e)
{
throw new ApiException(
"The requested node's api server was not reachable",
e.Message,
statusCode: 502
);
}
var result = Mapper.Map<StatusNodeResponse>(response);