Skip to content

Commit 1b1ef37

Browse files
logging and double parse
1 parent d1caf75 commit 1b1ef37

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lambdas/upsert-letter/src/handler/upsert-handler.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import {
1515
import z from "zod";
1616
import { MetricsLogger, Unit, metricScope } from "aws-embedded-metrics";
1717
import { Deps } from "../config/deps";
18+
import { Deployment$ } from "@aws-sdk/client-api-gateway";
19+
import { de } from "zod/v4/locales";
1820

1921
type SupplierSpec = { supplierId: string; specId: string };
2022
type PreparedEvents = LetterRequestPreparedEventV2 | LetterRequestPreparedEvent;
@@ -175,7 +177,12 @@ export default function createUpsertLetterHandler(deps: Deps): SQSHandler {
175177
const tasks = event.Records.map(async (record) => {
176178
let supplier = "unknown";
177179
try {
178-
const queueMessage = JSON.parse(record.body);
180+
deps.logger.info({
181+
description: "Received message from SQS",
182+
messageId: record.messageId,
183+
body: record.body,
184+
});
185+
const queueMessage = JSON.parse(JSON.parse(record.body));
179186

180187
const { letterEvent, supplierSpec } = queueMessage;
181188

0 commit comments

Comments
 (0)