From 4eae092031ebfa14059bc7d11542143d1c316fb5 Mon Sep 17 00:00:00 2001 From: TekH Date: Thu, 2 Apr 2026 20:38:01 +0200 Subject: [PATCH] Update result handling and error status in command handler Removed unused statusCode variable and now store HTTP status code as a string in the Info field. Changed exception handling to set Status to RecStatus.Error instead of RecStatus.Failed. --- .../RecActions/Commands/InvokeRecActionViewCommand.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs b/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs index 44afbdc..4e91a5d 100644 --- a/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs +++ b/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs @@ -142,14 +142,13 @@ public class InvokeRecActionViewCommandHandler( var resBody = await response.Content.ReadAsStringAsync(cancel); var resHeaders = response.Headers.ToDictionary(); - var statusCode = (short)response.StatusCode; - await sender.Send(new InsertResultCommand() { Status = response.StatusCode.ToRecStatus(), ActionId = action.Id, Header = JsonSerializer.Serialize(resHeaders, options: new() { WriteIndented = false }), Body = resBody, + Info = ((int)response.StatusCode).ToString(), Type = ResultType.Main }, cancel); } @@ -157,7 +156,7 @@ public class InvokeRecActionViewCommandHandler( { await sender.Send(new InsertResultCommand() { - Status = RecStatus.Failed, + Status = RecStatus.Error, ActionId = action.Id, Error = ex.ToString(), Type = ResultType.Main