diff options
Diffstat (limited to 'BackEnd/Timeline/SignalRHub/TimelineHub.cs')
-rw-r--r-- | BackEnd/Timeline/SignalRHub/TimelineHub.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/BackEnd/Timeline/SignalRHub/TimelineHub.cs b/BackEnd/Timeline/SignalRHub/TimelineHub.cs index 2ad7bd66..0bfda84c 100644 --- a/BackEnd/Timeline/SignalRHub/TimelineHub.cs +++ b/BackEnd/Timeline/SignalRHub/TimelineHub.cs @@ -32,19 +32,19 @@ namespace Timeline.SignalRHub var timelineId = await _timelineService.GetTimelineIdByNameAsync(timelineName);
var user = Context.User;
if (!user.HasPermission(UserPermission.AllTimelineManagement) && !await _timelineService.HasReadPermissionAsync(timelineId, user.GetOptionalUserId()))
- throw new HubException("Forbidden.");
+ throw new HubException(Resource.MessageForbidden);
var group = GenerateTimelinePostChangeListeningGroupName(timelineName);
await Groups.AddToGroupAsync(Context.ConnectionId, group);
- _logger.LogInformation("Add connection {0} to group {1}", Context.ConnectionId, group);
+ _logger.LogInformation(Resource.LogSubscribeTimelinePostChange, Context.ConnectionId, group);
}
catch (ArgumentException)
{
- throw new HubException("Timeline name is illegal.");
+ throw new HubException(Resource.MessageTimelineNameInvalid);
}
catch (EntityNotExistException)
{
- throw new HubException("Timeline not exist.");
+ throw new HubException(Resource.MessageTimelineNotExist);
}
}
@@ -52,7 +52,7 @@ namespace Timeline.SignalRHub {
var group = GenerateTimelinePostChangeListeningGroupName(timelineName);
await Groups.RemoveFromGroupAsync(Context.ConnectionId, group);
- _logger.LogInformation("Remove connection {0} from group {1}", Context.ConnectionId, group);
+ _logger.LogInformation(Resource.LogUnsubscribeTimelinePostChange, Context.ConnectionId, group);
}
}
}
|