Skip to content

Commit

Permalink
Merge pull request activepieces#5688 from alan-eu/olivier-sambourg/fe…
Browse files Browse the repository at this point in the history
…at-dust-improve-error-management

feat(dust): improve error management
  • Loading branch information
AbdulTheActivePiecer authored Sep 25, 2024
2 parents 5296e69 + f91e235 commit ce1e91a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/pieces/community/dust/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@activepieces/piece-dust",
"version": "0.1.3"
"version": "0.1.4"
}
7 changes: 4 additions & 3 deletions packages/pieces/community/dust/src/lib/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,15 @@ export async function getConversationContent(
retries += 1;
}

if (getConversationStatus(conversation.body) != 'succeeded') {
const conversationStatus = getConversationStatus(conversation.body);
if (conversationStatus != 'succeeded') {
if (retries >= maxRetries) {
throw new Error(
`Could not load conversation after ${timeout}s - consider increasing timeout value`
`Could not load conversation ${conversationId} after ${timeout}s - consider increasing timeout value`
);
} else {
throw new Error(
`Could not load conversation: ${
`Could not load conversation ${conversationId} - ${conversationStatus}: ${
conversation.body['conversation']['content']?.at(-1)?.at(0)?.error
}`
);
Expand Down

0 comments on commit ce1e91a

Please sign in to comment.