MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / handleToolError

Function handleToolError

packages/core/src/tracing/langchain/index.ts:338–351  ·  view source on GitHub ↗
(error: Error, runId: string)

Source from the content-addressed store, hash-verified

336
337 // Tool Error Handler
338 handleToolError(error: Error, runId: string) {
339 const span = spanMap.get(runId);
340 if (span?.isRecording()) {
341 span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
342 exitSpan(runId);
343 }
344
345 captureException(error, {
346 mechanism: {
347 handled: false,
348 type: `${LANGCHAIN_ORIGIN}.tool_error_handler`,
349 },
350 });
351 },
352
353 // LangChain BaseCallbackHandler required methods
354 copy() {

Callers

nothing calls this directly

Calls 5

captureExceptionFunction · 0.90
exitSpanFunction · 0.85
getMethod · 0.65
isRecordingMethod · 0.65
setStatusMethod · 0.65

Tested by

no test coverage detected