🔊 Add response debug log for failing requests without errors

This commit is contained in:
Baptiste Arnaud
2023-11-17 15:42:40 +01:00
parent 3a47a0fcbd
commit 5298538ecb
7 changed files with 17 additions and 12 deletions

View File

@@ -51,7 +51,7 @@ export const Bot = (props: BotProps & { class?: string }) => {
typeof props.typebot === 'string' ? props.typebot : undefined
const isPreview =
typeof props.typebot !== 'string' || (props.isPreview ?? false)
const { data, error } = await startChatQuery({
const { data, error, response } = await startChatQuery({
stripeRedirectStatus: urlParams.get('redirect_status') ?? undefined,
typebot: props.typebot,
apiHost: props.apiHost,
@@ -81,6 +81,7 @@ export const Bot = (props: BotProps & { class?: string }) => {
if (!data) {
if (error) console.error(error)
console.error({ data, error, response })
return setError(new Error("Error! Couldn't initiate the chat."))
}