chore: CRM logging, add booking uid (#18256)

* Add more logging

* Add conditional
This commit is contained in:
Joe Au-Yeung
2024-12-18 21:23:04 +01:00
committed by GitHub
parent b56824e626
commit ebc3ced687
+2 -2
View File
@@ -981,7 +981,7 @@ export default class EventManager {
success = false;
// We don't know the type of the error here, so for an Error instance we can read message but otherwise we stringify the error
const errorMsg = error instanceof Error ? error.message : JSON.stringify(error);
log.warn(`Error creating crm event for ${credential.type}`, errorMsg);
log.warn(`Error creating crm event for ${credential.type} for booking ${event?.uid}`, errorMsg);
});
if (createdEvent) {
@@ -1015,7 +1015,7 @@ export default class EventManager {
const crm = new CrmManager(credential);
const updatedEvent = await crm.updateEvent(reference.uid, event).catch((error) => {
success = false;
log.warn(`Error updating crm event for ${credential.type}`, error);
log.warn(`Error updating crm event for ${credential.type} for booking ${event?.uid}`, error);
});
updatedEvents.push({