File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 "@types/js-yaml" : " ^4.0.5" ,
2121 "@types/ldap-escape" : " ^2.0.0" ,
2222 "@types/ldapjs" : " ^2.2.5" ,
23+ "@types/node" : " ^20.4.8" ,
2324 "@types/swagger-ui-express" : " ^4.1.3" ,
2425 "nodemon" : " ^2.0.21" ,
2526 "shx" : " ^0.3.4" ,
Original file line number Diff line number Diff line change 11const appInsights = require ( "applicationinsights" ) ;
22
3- import { SeverityLevel , TelemetryType } from "applicationinsights/out/Declarations/Contracts" ;
3+ import { SeverityLevel } from "applicationinsights/out/Declarations/Contracts" ;
44import TelemetryClient from "applicationinsights/out/Library/TelemetryClient" ;
55
66interface ILogger {
@@ -51,8 +51,8 @@ export function LogError(ex: string) {
5151export function SetupLogging ( ) {
5252 if ( process . env . APPLICATIONINSIGHTS_CONNECTION_STRING ) {
5353 console . log ( "Using AppInsights Logger" )
54- appInsights . setup ( process . env . APPLICATIONINSIGHTS_CONNECTION_STRING ) . start ( ) ;
55-
54+ appInsights . setup ( process . env . APPLICATIONINSIGHTS_CONNECTION_STRING ) . start ( ) ;
55+
5656 const telemetryClient = appInsights . defaultClient ;
5757
5858 logger = new AiLogger ( telemetryClient ) ;
Original file line number Diff line number Diff line change @@ -97,7 +97,9 @@ async function SearchAllAsyncNoExceptionHandling(groupName: string): SearchAllRe
9797 } ) ;
9898
9999 response . on ( 'end' , ( result : any ) => {
100- if ( result . status !== 0 ) {
100+ Log ( `Search Ended for Group '${ groupName } ' with result '${ JSON . stringify ( result ) } '` )
101+
102+ if ( result ?. status !== 0 || result == null || result == undefined ) {
101103 return reject ( result . status ) ;
102104 }
103105
@@ -109,7 +111,7 @@ async function SearchAllAsyncNoExceptionHandling(groupName: string): SearchAllRe
109111 } ) ;
110112
111113 response . on ( 'error' , ( err : any ) => {
112- Log ( 'error: ' + err . message ) ;
114+ LogError ( `Search Errored for Group ' ${ groupName } ': ${ JSON . stringify ( err ) } ` ) ;
113115 return reject ( ) ;
114116 } ) ;
115117
You can’t perform that action at this time.
0 commit comments