linting
This commit is contained in:
@@ -33,7 +33,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
}
|
||||
return notification;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding notification by ID ${id}:`, error);
|
||||
this.logger.error(`Error finding notification by ID ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
this.logger.info(`Found ${notifications.length} notifications for recipient ID: ${recipientId}.`);
|
||||
return notifications;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding notifications for recipient ID ${recipientId}:`, error);
|
||||
this.logger.error(`Error finding notifications for recipient ID ${recipientId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
this.logger.info(`Found ${notifications.length} unread notifications for recipient ID: ${recipientId}.`);
|
||||
return notifications;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding unread notifications for recipient ID ${recipientId}:`, error);
|
||||
this.logger.error(`Error finding unread notifications for recipient ID ${recipientId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
this.logger.info(`Counted ${count} unread notifications for recipient ID: ${recipientId}.`);
|
||||
return count;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error counting unread notifications for recipient ID ${recipientId}:`, error);
|
||||
this.logger.error(`Error counting unread notifications for recipient ID ${recipientId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
this.notifications.set(notification.id, notification);
|
||||
this.logger.info(`Notification ${notification.id} created successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating notification ${notification.id}:`, error);
|
||||
this.logger.error(`Error creating notification ${notification.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
this.notifications.set(notification.id, notification);
|
||||
this.logger.info(`Notification ${notification.id} updated successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating notification ${notification.id}:`, error);
|
||||
this.logger.error(`Error updating notification ${notification.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
this.logger.warn(`Notification with ID ${id} not found for deletion.`);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting notification ${id}:`, error);
|
||||
this.logger.error(`Error deleting notification ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
toDelete.forEach(id => this.notifications.delete(id));
|
||||
this.logger.info(`Deleted ${toDelete.length} notifications for recipient ID: ${recipientId}.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting all notifications for recipient ID ${recipientId}:`, error);
|
||||
this.logger.error(`Error deleting all notifications for recipient ID ${recipientId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
});
|
||||
this.logger.info(`Marked ${toUpdate.length} notifications as read for recipient ID: ${recipientId}.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error marking all notifications as read for recipient ID ${recipientId}:`, error);
|
||||
this.logger.error(`Error marking all notifications as read for recipient ID ${recipientId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user