0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

fixup! Added logging to collections event handlers

This commit is contained in:
Fabien "egg" O'Carroll 2023-09-08 14:25:28 +07:00 committed by Fabien 'egg' O'Carroll
parent c6f908d31d
commit ff8a3fbf32

View file

@ -178,7 +178,7 @@ export class CollectionsService {
try { try {
await this.removePostFromAllCollections(event.id); await this.removePostFromAllCollections(event.id);
} catch (err) { } catch (err) {
logging.error({err}); logging.error({err, message: 'Error handling PostDeletedEvent'});
} }
}); });
@ -187,7 +187,7 @@ export class CollectionsService {
try { try {
await this.addPostToMatchingCollections(event.data); await this.addPostToMatchingCollections(event.data);
} catch (err) { } catch (err) {
logging.error({err}); logging.error({err, message: 'Error handling PostAddedEvent'});
} }
}); });
@ -200,7 +200,7 @@ export class CollectionsService {
try { try {
await this.updatePostInMatchingCollections(event.data); await this.updatePostInMatchingCollections(event.data);
} catch (err) { } catch (err) {
logging.error({err}); logging.error({err, message: 'Error handling PostEditedEvent'});
} }
}); });
@ -209,7 +209,7 @@ export class CollectionsService {
try { try {
await this.removePostsFromAllCollections(event.data); await this.removePostsFromAllCollections(event.data);
} catch (err) { } catch (err) {
logging.error({err}); logging.error({err, message: 'Error handling PostsBulkDestroyedEvent'});
} }
}); });
@ -218,7 +218,7 @@ export class CollectionsService {
try { try {
await this.updateUnpublishedPosts(event.data); await this.updateUnpublishedPosts(event.data);
} catch (err) { } catch (err) {
logging.error({err}); logging.error({err, message: 'Error handling PostsBulkUnpublishedEvent'});
} }
}); });
@ -227,7 +227,7 @@ export class CollectionsService {
try { try {
await this.updateFeaturedPosts(event.data); await this.updateFeaturedPosts(event.data);
} catch (err) { } catch (err) {
logging.error({err}); logging.error({err, message: 'Error handling PostsBulkFeaturedEvent'});
} }
}); });
@ -236,7 +236,7 @@ export class CollectionsService {
try { try {
await this.updateFeaturedPosts(event.data); await this.updateFeaturedPosts(event.data);
} catch (err) { } catch (err) {
logging.error({err}); logging.error({err, message: 'Error handling PostsBulkUnfeaturedEvent'});
} }
}); });
@ -245,7 +245,7 @@ export class CollectionsService {
try { try {
await this.updateAllAutomaticCollections(); await this.updateAllAutomaticCollections();
} catch (err) { } catch (err) {
logging.error({err}); logging.error({err, message: 'Error handling TagDeletedEvent'});
} }
}); });
@ -254,7 +254,7 @@ export class CollectionsService {
try { try {
await this.updateAllAutomaticCollections(); await this.updateAllAutomaticCollections();
} catch (err) { } catch (err) {
logging.error({err}); logging.error({err, message: 'Error handling PostsBulkAddTagsEvent'});
} }
}); });
} }