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:
tusharmagar 2026-03-30 02:00:10 +05:30
parent 9e6683984c
commit eb6d50c7bd

View file

@ -1333,12 +1333,21 @@ function registerComposioTools(): void {
error: `Toolkit "${toolkitSlug}" is not connected. Please connect it in Settings > Tools Library.`,
};
}
return executeComposioAction(slug, {
connected_account_id: account.id,
user_id: 'rowboat-user',
version: 'latest',
arguments: input,
});
try {
return await executeComposioAction(slug, {
connected_account_id: account.id,
user_id: 'rowboat-user',
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 () => {
return (await isComposioConfigured()) && composioAccountsRepo.isConnected(toolkitSlug);