My Node.js handler throws a 502 when JSON.parse(event.body) hits a malformed payload from GC. The event log shows the webhook fired, but the retry policy isn’t kicking in like it should. Here’s the snippet:
exports.handler = async (event) => {
try {
const body = JSON.parse(event.body);
// process
} catch (e) {
return { statusCode: 500, body: 'bad json' };
}
};
GC expects a 2xx to stop retries. If I return 500, it retries forever. If I return 200 on error, I lose the data. How do I signal GC to move this to the dead letter queue instead?