@@ -602,7 +602,7 @@ export class AiAssistantService {
602602 console . error ( "OpenAI error:" , error ) ;
603603 Sentry . withScope ( ( scope ) => {
604604 scope . setTag ( "emailId" , emailId ) ;
605- scope . setExtra ( "emailId ", emailId ) ;
605+ scope . setTag ( "errorType ", "AI" ) ;
606606 Sentry . captureException ( error . message ) ;
607607 } ) ;
608608 client . send (
@@ -651,7 +651,7 @@ export class AiAssistantService {
651651 if ( ! this . deepseekClient ) {
652652 Sentry . withScope ( ( scope ) => {
653653 scope . setTag ( "emailId" , emailId ) ;
654- scope . setExtra ( "emailId ", emailId ) ;
654+ scope . setTag ( "errorType ", "AI" ) ;
655655 Sentry . captureException ( "DeepSeek Initialization Failed." ) ;
656656 } ) ;
657657 throw new InternalServerErrorException (
@@ -674,7 +674,7 @@ export class AiAssistantService {
674674 console . warn ( "Failed to parse conversation:" , error ) ;
675675 Sentry . withScope ( ( scope ) => {
676676 scope . setTag ( "emailId" , emailId ) ;
677- scope . setExtra ( "emailId ", emailId ) ;
677+ scope . setTag ( "errorType ", "AI" ) ;
678678 Sentry . captureException ( error ) ;
679679 } ) ;
680680 }
@@ -765,7 +765,7 @@ export class AiAssistantService {
765765 console . warn ( "Kafka logging failed" , e ) ;
766766 Sentry . withScope ( ( scope ) => {
767767 scope . setTag ( "emailId" , emailId ) ;
768- scope . setExtra ( "emailId ", emailId ) ;
768+ scope . setTag ( "errorType ", "AI" ) ;
769769 Sentry . captureException ( e ) ;
770770 } ) ;
771771 }
@@ -786,7 +786,7 @@ export class AiAssistantService {
786786 console . warn ( "Kafka logging failed" , e ) ;
787787 Sentry . withScope ( ( scope ) => {
788788 scope . setTag ( "emailId" , emailId ) ;
789- scope . setExtra ( "emailId ", emailId ) ;
789+ scope . setTag ( "errorType ", "AI" ) ;
790790 Sentry . captureException ( e ) ;
791791 } ) ;
792792 }
@@ -799,7 +799,7 @@ export class AiAssistantService {
799799 console . error ( "Invalid JSON in event data:" , event . data , e ) ;
800800 Sentry . withScope ( ( scope ) => {
801801 scope . setTag ( "emailId" , emailId ) ;
802- scope . setExtra ( "emailId ", emailId ) ;
802+ scope . setTag ( "errorType ", "AI" ) ;
803803 Sentry . captureException ( e ) ;
804804 } ) ;
805805 }
@@ -808,7 +808,7 @@ export class AiAssistantService {
808808 console . error ( "DeepSeek error:" , error ) ;
809809 Sentry . withScope ( ( scope ) => {
810810 scope . setTag ( "emailId" , emailId ) ;
811- scope . setExtra ( "emailId ", emailId ) ;
811+ scope . setTag ( "errorType ", "AI" ) ;
812812 Sentry . captureException ( error ) ;
813813 } ) ;
814814 client . send (
@@ -1119,7 +1119,7 @@ export class AiAssistantService {
11191119 const endTime = performance . now ( ) ;
11201120 Sentry . withScope ( ( scope ) => {
11211121 scope . setTag ( "emailId" , emailId ) ;
1122- scope . setExtra ( "emailId ", emailId ) ;
1122+ scope . setTag ( "errorType ", "AI" ) ;
11231123 Sentry . captureException ( error . message ) ;
11241124 } ) ;
11251125 const timeTaken = Math . round ( endTime - startTime ) ;
@@ -1349,7 +1349,7 @@ export class AiAssistantService {
13491349 const endTime = performance . now ( ) ;
13501350 Sentry . withScope ( ( scope ) => {
13511351 scope . setTag ( "emailId" , emailId ) ;
1352- scope . setExtra ( "emailId ", emailId ) ;
1352+ scope . setTag ( "errorType ", "AI" ) ;
13531353 Sentry . captureException ( error . message ) ;
13541354 } ) ;
13551355 const timeTaken = Math . round ( endTime - startTime ) ;
@@ -1540,7 +1540,7 @@ export class AiAssistantService {
15401540 const endTime = performance . now ( ) ;
15411541 Sentry . withScope ( ( scope ) => {
15421542 scope . setTag ( "emailId" , emailId ) ;
1543- scope . setExtra ( "emailId ", emailId ) ;
1543+ scope . setTag ( "errorType ", "AI" ) ;
15441544 Sentry . captureException ( error . message ) ;
15451545 } ) ;
15461546 const timeTaken = Math . round ( endTime - startTime ) ;
@@ -1787,7 +1787,7 @@ export class AiAssistantService {
17871787 const endTime = performance . now ( ) ;
17881788 Sentry . withScope ( ( scope ) => {
17891789 scope . setTag ( "emailId" , emailId ) ;
1790- scope . setExtra ( "emailId ", emailId ) ;
1790+ scope . setTag ( "errorType ", "AI" ) ;
17911791 Sentry . captureException ( error . message ) ;
17921792 } ) ;
17931793 const timeTaken = Math . round ( endTime - startTime ) ;
@@ -1830,7 +1830,7 @@ export class AiAssistantService {
18301830 } catch ( err ) {
18311831 Sentry . withScope ( ( scope ) => {
18321832 scope . setTag ( "emailId" , parsedData . emailId ) ;
1833- scope . setExtra ( "emailId ", parsedData . emailId ) ;
1833+ scope . setTag ( "errorType ", "AI" ) ;
18341834 Sentry . captureException ( err ) ;
18351835 } ) ;
18361836 client . send (
@@ -2042,7 +2042,8 @@ export class AiAssistantService {
20422042 }
20432043 } catch ( error ) {
20442044 console . error ( "Error in WebSocket loop:" , error ) ;
2045- Sentry . withScope ( ( scope ) => {
2045+ Sentry . withScope ( ( scope ) => {
2046+ scope . setTag ( "errorType" , "AI" ) ;
20462047 Sentry . captureException ( error ) ;
20472048 } ) ;
20482049 if ( client . readyState === WebSocket . OPEN ) {
@@ -2143,7 +2144,7 @@ export class AiAssistantService {
21432144 console . error ( "Error processing prompt generation:" , error ) ;
21442145 Sentry . withScope ( ( scope ) => {
21452146 scope . setTag ( "emailId" , data . emailId ) ;
2146- scope . setExtra ( "emailId ", data . emailId ) ;
2147+ scope . setTag ( "errorType ", "AI" ) ;
21472148 Sentry . captureException ( error ) ;
21482149 } ) ;
21492150 throw new BadRequestException (
0 commit comments