mirror of
https://github.com/baptisteArno/typebot.io.git
synced 2026-06-25 21:01:54 +08:00
🐛 Fix webhook listening error when body is not JSON
This commit is contained in:
parent
e1c7c27667
commit
9a1907d7c7
@ -283,11 +283,16 @@ const processNonInputBlock = async ({
|
||||
try {
|
||||
response = JSON.parse(reply.text);
|
||||
} catch (err) {
|
||||
throw new TRPCError({
|
||||
code: "BAD_REQUEST",
|
||||
message: "Provided response is not valid JSON",
|
||||
cause: (await parseUnknownError({ err })).description,
|
||||
});
|
||||
if (block.type === IntegrationBlockType.HTTP_REQUEST)
|
||||
throw new TRPCError({
|
||||
code: "BAD_REQUEST",
|
||||
message: "Provided response is not valid JSON",
|
||||
cause: (await parseUnknownError({ err })).description,
|
||||
});
|
||||
response = {
|
||||
statusCode: 200,
|
||||
data: reply.text,
|
||||
};
|
||||
}
|
||||
const result = saveDataInResponseVariableMapping({
|
||||
state,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user