File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,6 @@ const fs = require("fs");
44const  {  trace,  SpanStatusCode }  =  require ( "@opentelemetry/api" ) ; 
55const  ErrorStackParser  =  require ( "error-stack-parser" ) ; 
66
7- let  hasException  =  false ;  // Track if an exception has already been processed 
8- 
97/** 
108 * Check if file is external (node_modules, etc.) 
119 * @param  {string } filePath - The file path 
@@ -169,7 +167,7 @@ function findContainingFunction(lines, targetLine) {
169167 */ 
170168function  createExceptionSpanEvent ( error )  { 
171169  const  span  =  trace . getActiveSpan ( ) ; 
172-    
170+ 
173171  if  ( ! span )  { 
174172    // Create a new span if none is active 
175173    const  tracer  =  trace . getTracer ( "@middleware.io/agent-apm-nextjs" ) ; 
@@ -191,8 +189,6 @@ function createExceptionSpanEvent(error) {
191189 * @param  {Error } error - The error object 
192190 */ 
193191function  addExceptionEvent ( span ,  error )  { 
194-   if  ( hasException )  return ;  // Prevent duplicate events 
195-   hasException  =  true ; 
196192  // Add function context information 
197193  const  structuredStack  =  jsonToString ( ErrorStackParser . parse ( error ) ) ; 
198194
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments