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

Function handleLLMError

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

Source from the content-addressed store, hash-verified

184
185 // LLM Error Handler - note: handleLLMError with capital LLM
186 handleLLMError(error: Error, runId: string) {
187 const span = spanMap.get(runId);
188 if (span?.isRecording()) {
189 span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
190 exitSpan(runId);
191 }
192
193 captureException(error, {
194 mechanism: {
195 handled: false,
196 type: `${LANGCHAIN_ORIGIN}.llm_error_handler`,
197 },
198 });
199 },
200
201 // Chain Start Handler
202 handleChainStart(

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