@@ -22,6 +22,7 @@ import { APIContact } from "./api-contact.model";
22
22
import { CacheItemStateType } from "./cache-item-state.model" ;
23
23
import { CalendarFilterOptions } from "./calendar-filter-options.model" ;
24
24
import { errorLogger , infoLogger } from "../util/logger.util" ;
25
+ import { IntegrationErrorType } from "./integration-error.model" ;
25
26
26
27
const CONTACT_FETCH_TIMEOUT : number = 3000 ;
27
28
@@ -114,6 +115,15 @@ export class Controller {
114
115
115
116
res . status ( 200 ) . send ( responseContacts ) ;
116
117
} catch ( error ) {
118
+ // prevent logging of refresh errors
119
+ if (
120
+ error instanceof ServerError &&
121
+ error . message === IntegrationErrorType . INTEGRATION_REFRESH_ERROR
122
+ ) {
123
+ next ( error ) ;
124
+ return ;
125
+ }
126
+
117
127
errorLogger (
118
128
"Could not get contacts:" ,
119
129
providerConfig ,
@@ -170,6 +180,15 @@ export class Controller {
170
180
}
171
181
}
172
182
} catch ( error ) {
183
+ // prevent logging of refresh errors
184
+ if (
185
+ error instanceof ServerError &&
186
+ error . message === IntegrationErrorType . INTEGRATION_REFRESH_ERROR
187
+ ) {
188
+ next ( error ) ;
189
+ return ;
190
+ }
191
+
173
192
console . error (
174
193
`[${ anonymizeKey ( apiKey ) } ] Could not create contact` ,
175
194
error || "Unknown"
@@ -228,6 +247,15 @@ export class Controller {
228
247
}
229
248
}
230
249
} catch ( error ) {
250
+ // prevent logging of refresh errors
251
+ if (
252
+ error instanceof ServerError &&
253
+ error . message === IntegrationErrorType . INTEGRATION_REFRESH_ERROR
254
+ ) {
255
+ next ( error ) ;
256
+ return ;
257
+ }
258
+
231
259
console . error ( "Could not update contact:" , error || "Unknown" ) ;
232
260
next ( error ) ;
233
261
}
@@ -269,6 +297,15 @@ export class Controller {
269
297
}
270
298
}
271
299
} catch ( error ) {
300
+ // prevent logging of refresh errors
301
+ if (
302
+ error instanceof ServerError &&
303
+ error . message === IntegrationErrorType . INTEGRATION_REFRESH_ERROR
304
+ ) {
305
+ next ( error ) ;
306
+ return ;
307
+ }
308
+
272
309
console . error ( "Could not delete contact:" , error || "Unknown" ) ;
273
310
next ( error ) ;
274
311
}
0 commit comments