LCOV - code coverage report
Current view: top level - src/platform/telemetry - sentryEvaluatedCommandCaller.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 11.1 % 9 1
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import type { ErrorEvent } from '@sentry/vue'
       2              : 
       3         2356 : const UNKNOWN_COMMAND = /^Command .* not found$/s
       4              : const COMMAND_STORE_FRAME_DEPTH = 2
       5              : 
       6            0 : function isCalledFromEvaluatedCode(event: ErrorEvent): boolean {
       7            0 :   const exception = event.exception?.values?.at(-1)
       8            0 :   if (!UNKNOWN_COMMAND.test(exception?.value ?? '')) return false
       9              : 
      10            0 :   const caller = exception?.stacktrace?.frames?.at(
      11              :     -(COMMAND_STORE_FRAME_DEPTH + 1)
      12              :   )
      13            0 :   return caller?.filename === '<anonymous>' && caller.lineno !== undefined
      14              : }
      15              : 
      16            0 : export function tagSentryEvaluatedCommandCaller(event: ErrorEvent): ErrorEvent {
      17            0 :   if (!isCalledFromEvaluatedCode(event)) return event
      18            0 :   return { ...event, tags: { ...event.tags, error_origin: 'third_party' } }
      19              : }
        

Generated by: LCOV version 2.0-1