mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
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:
+2
-8
@@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user