Skip to content

Commit

Permalink
Add error logging to core sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
peterszerzo committed Dec 27, 2023
1 parent 8818ef5 commit fbda9bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/chat-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ export const createConversation = (config: Config): ConversationHandler => {
newResponse,
);
} else {
console.warn(
"Invalid message structure, expected object with field 'messages'.",
);
failureHandler();
}
};
Expand Down Expand Up @@ -335,7 +338,10 @@ export const createConversation = (config: Config): ConversationHandler => {
)
.then((res: any) => res.json())
.then(messageResponseHandler)
.catch(failureHandler);
.catch((err) => {
console.warn(err);
failureHandler();
});
}
};

Expand Down

0 comments on commit fbda9bd

Please sign in to comment.