Commit 9e661054 authored by Cloud User's avatar Cloud User

log return err

parent 4e2bc88d
......@@ -1439,6 +1439,7 @@ func Return(c *fiber.Ctx, resAsPb pbUpstream.TaskResponse, baseAttributes []slog
if err := encoder.Encode(resAsJson); err != nil {
newAttributes := append(baseAttributes, slog.String("err", err.Error()))
slog.LogAttrs(c.UserContext(), slog.LevelError, "encoder.Encode(resAsJson)", newAttributes...)
return err
}
newAttributes := append(baseAttributes,
......@@ -1460,7 +1461,13 @@ func Return(c *fiber.Ctx, resAsPb pbUpstream.TaskResponse, baseAttributes []slog
slog.LogAttrs(c.UserContext(), slog.LevelInfo, "http return", newAttributes...)
return c.Status(int(resAsPb.TaskResultCode)).JSON(resAsJson)
if err := c.Status(int(resAsPb.TaskResultCode)).JSON(resAsJson); err != nil {
newAttributes := append(baseAttributes, slog.String("err", err.Error()))
slog.LogAttrs(c.UserContext(), slog.LevelError, "c.Status(int(resAsPb.TaskResultCode)).JSON(resAsJson)", newAttributes...)
return err
}
return nil
//return c.JSON(resAsJson)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment