(type: InstrumentHandlerType, data: unknown)
| 58 | |
| 59 | /** Trigger handlers for a given instrumentation type. */ |
| 60 | export function triggerHandlers(type: InstrumentHandlerType, data: unknown): void { |
| 61 | const typeHandlers = type && handlers[type]; |
| 62 | if (!typeHandlers) { |
| 63 | return; |
| 64 | } |
| 65 | |
| 66 | for (const handler of typeHandlers) { |
| 67 | try { |
| 68 | handler(data); |
| 69 | } catch (e) { |
| 70 | DEBUG_BUILD && |
| 71 | debug.error( |
| 72 | `Error while triggering instrumentation handler.\nType: ${type}\nName: ${getFunctionName(handler)}\nError:`, |
| 73 | e, |
| 74 | ); |
| 75 | } |
| 76 | } |
| 77 | } |
no test coverage detected