Skip to content

Commit a110f72

Browse files
committed
Fix hub is busy response and error handling
1 parent 2922a4a commit a110f72

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

LiveControlGateway/Controllers/HubControllerBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ protected override async Task<OneOf<Success, Error<OpenShockProblem>>> Connectio
141141
if (hubLifetimeResult.IsT1)
142142
{
143143
Logger.LogWarning("Hub lifetime busy, closing connection");
144-
return new Error<OpenShockProblem>(ExceptionError.Exception);
144+
return new Error<OpenShockProblem>(WebsocketError.WebsocketHubLifetimeBusy);
145145
}
146146

147147
if (hubLifetimeResult.IsT2)
148148
{
149149
Logger.LogError("Hub lifetime error, closing connection");
150-
return new Error<OpenShockProblem>();
150+
return new Error<OpenShockProblem>(ExceptionError.Exception);
151151
}
152152

153153
_hubLifetime = hubLifetimeResult.AsT0;

LiveControlGateway/LifetimeManager/HubLifetimeManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ public async Task RemoveDeviceConnection(IHubController hubController)
135135
{
136136
if (!_lifetimes.TryGetValue(hubController.Id, out hubLifetime))
137137
{
138-
_logger.LogError("Hub lifetime not found for hub [{HubId}]", hubController.Id);
138+
// its fine, this is also the case when a precondition is not met for example.
139+
_logger.LogDebug("Hub lifetime not found for hub [{HubId}]", hubController.Id);
139140
return;
140141
}
141142

0 commit comments

Comments
 (0)