Update result status handling in InsertResultCommand
Replaced StatusId with Status property in InsertResultCommand, mapping HTTP status codes to application-specific status enums using ToStatus(). Exception handling now sets Status to QueryFailed. Removed usage of StatusId.
This commit is contained in:
@@ -146,7 +146,7 @@ public class InvokeRecActionViewCommandHandler(
|
|||||||
|
|
||||||
await sender.Send(new InsertResultCommand()
|
await sender.Send(new InsertResultCommand()
|
||||||
{
|
{
|
||||||
StatusId = statusCode,
|
Status = response.StatusCode.ToStatus(),
|
||||||
ActionId = action.Id,
|
ActionId = action.Id,
|
||||||
Header = JsonSerializer.Serialize(resHeaders, options: new() { WriteIndented = false }),
|
Header = JsonSerializer.Serialize(resHeaders, options: new() { WriteIndented = false }),
|
||||||
Body = resBody,
|
Body = resBody,
|
||||||
@@ -157,6 +157,7 @@ public class InvokeRecActionViewCommandHandler(
|
|||||||
{
|
{
|
||||||
await sender.Send(new InsertResultCommand()
|
await sender.Send(new InsertResultCommand()
|
||||||
{
|
{
|
||||||
|
Status = Status.QueryFailed,
|
||||||
ActionId = action.Id,
|
ActionId = action.Id,
|
||||||
Error = ex.ToString(),
|
Error = ex.ToString(),
|
||||||
Type = ResultType.Main
|
Type = ResultType.Main
|
||||||
|
|||||||
Reference in New Issue
Block a user