Fixed error handling in reverse proxy, use executor as centralized place to handle errors. Error bubbles up to proxy -> executor -> block log -> custom console

This commit is contained in:
Waleed Latif
2025-02-03 12:11:03 -08:00
parent 6c29d61652
commit b67494eeef
3 changed files with 77 additions and 106 deletions
+2 -8
View File
@@ -60,25 +60,19 @@ export async function executeTool(
const result = await response.json()
if (!result.success) {
// Format error message to include details if available
const errorMessage = result.details
? `${result.error} (${JSON.stringify(result.details)})`
: result.error
return {
success: false,
output: {},
error: errorMessage
error: result.error
}
}
return result
} catch (error: any) {
console.error('Tool execution error:', error)
return {
success: false,
output: {},
error: `Error executing tool: ${error.message || 'Unknown error'}`
error: error.message || 'Unknown error'
}
}
}