mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-28 19:05:31 +02:00
Enhance error handling in Composio tool execution. Added try-catch block to log errors and return a structured error response when executing tools fails.
This commit is contained in:
parent
9e6683984c
commit
eb6d50c7bd
1 changed files with 15 additions and 6 deletions
|
|
@ -1333,12 +1333,21 @@ function registerComposioTools(): void {
|
||||||
error: `Toolkit "${toolkitSlug}" is not connected. Please connect it in Settings > Tools Library.`,
|
error: `Toolkit "${toolkitSlug}" is not connected. Please connect it in Settings > Tools Library.`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return executeComposioAction(slug, {
|
try {
|
||||||
connected_account_id: account.id,
|
return await executeComposioAction(slug, {
|
||||||
user_id: 'rowboat-user',
|
connected_account_id: account.id,
|
||||||
version: 'latest',
|
user_id: 'rowboat-user',
|
||||||
arguments: input,
|
version: 'latest',
|
||||||
});
|
arguments: input,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
const message = error instanceof Error ? error.message : String(error);
|
||||||
|
console.error(`[Composio] Tool execution failed for ${slug}:`, message);
|
||||||
|
return {
|
||||||
|
success: false,
|
||||||
|
error: `Failed to execute ${slug}: ${message}`,
|
||||||
|
};
|
||||||
|
}
|
||||||
},
|
},
|
||||||
isAvailable: async () => {
|
isAvailable: async () => {
|
||||||
return (await isComposioConfigured()) && composioAccountsRepo.isConnected(toolkitSlug);
|
return (await isComposioConfigured()) && composioAccountsRepo.isConnected(toolkitSlug);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue