Skip to content

Commit 3a656b7

Browse files
committed
handle payload serialization in the same way inside the catch
1 parent c4ca399 commit 3a656b7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ailogger-output.log

Whitespace-only changes.

internal-packages/run-engine/src/batch-queue/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,11 @@ export class BatchQueue {
916916
"BatchQueue.serializePayload",
917917
async (innerSpan) => {
918918
const str =
919-
typeof item.payload === "string" ? item.payload : JSON.stringify(item.payload);
919+
item.payload === undefined || item.payload === null
920+
? "{}"
921+
: typeof item.payload === "string"
922+
? item.payload
923+
: JSON.stringify(item.payload);
920924
innerSpan?.setAttribute("batch.payloadSize", str.length);
921925
return str;
922926
}

0 commit comments

Comments
 (0)