Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: unhandled error

Nevo David56b78111a7c7
diff --git a/apps/workers/src/app/posts.controller.ts b/apps/workers/src/app/posts.controller.ts
index 613797ede..19fe9b513 100644
--- a/apps/workers/src/app/posts.controller.ts
+++ b/apps/workers/src/app/posts.controller.ts
@@ -15,7 +15,11 @@ export class PostsController {
@EventPattern('post', Transport.REDIS)
async post(data: { id: string }) {
console.log('processing', data);
- return this._postsService.post(data.id);
+ try {
+ return await this._postsService.post(data.id);
+ } catch (err) {
+ console.log('Unhandled error, let\'s avoid crashing the worker', err);
+ }
}
@EventPattern('submit', Transport.REDIS)