From 12cf5a1e94f76497f01a511cdb301d3b0b286e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Eggert=20Lundsteen=20Olsen?= Date: Fri, 2 Oct 2026 13:09:02 +0200 Subject: [PATCH] Review 1.3: a request that fails in an unexpected way is completed as failed, not left Running HandleAsync only turned a few exception types into the request's error; anything else (a lock or command timeout, a JSON or argument error) escaped, leaving the row Running and the page waiting until housekeeping failed it minutes later. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/SQLInsight.Agent/Configuration/AgentRequestService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SQLInsight.Agent/Configuration/AgentRequestService.cs b/src/SQLInsight.Agent/Configuration/AgentRequestService.cs index 297fe86..37da56e 100644 --- a/src/SQLInsight.Agent/Configuration/AgentRequestService.cs +++ b/src/SQLInsight.Agent/Configuration/AgentRequestService.cs @@ -104,7 +104,9 @@ public sealed partial class AgentRequestService( { error = $"Agenten fik ikke svar inden for {RequestTimeout.TotalMinutes:0} minutter."; } - catch (Exception ex) when (ex is CredentialException or KeyNotFoundException or InvalidOperationException or DiscoveryFailedException or DbException) + // Anything else (a lock timeout, a repository error while storing a discovery …) is the request's result too, so it + // is never left as Running for the web UI to wait on. + catch (Exception ex) when (ex is not OperationCanceledException) { error = ex.Message; }