api: handle subscription fetch errors

This commit is contained in:
Abdullah Atta authored and Abdullah Atta committed 2025-10-07 16:44:15 +05:00
1 parent 72e825a12c
commit 2b6a58ff04
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -118,7 +118,7 @@ namespace Notesnook.API.Services
else
{
var subscriptionService = await WampServers.SubscriptionServer.GetServiceAsync<IUserSubscriptionService>(SubscriptionServerTopics.UserSubscriptionServiceTopic);
subscription = await subscriptionService.GetUserSubscriptionAsync(Clients.Notesnook.Id, userId);
subscription = await subscriptionService.GetUserSubscriptionAsync(Clients.Notesnook.Id, userId) ?? throw new Exception("User subscription not found.");
}
var userSettings = await Repositories.UsersSettings.FindOneAsync((u) => u.UserId == user.UserId) ?? throw new Exception("User settings not found.");