Skip to content

Commit e2a518d

Browse files
Renamed Exception variables to better distinguish between them
1 parent 5c45a7b commit e2a518d

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

  • agent/Modules/MTConnect.NET-AgentModule-MqttRelay

agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,22 +214,19 @@ private async Task Worker()
214214
await Task.Delay(100);
215215
}
216216
}
217-
catch (Exception ex)
217+
catch (Exception exception)
218218
{
219-
220-
Log(MTConnectLogLevel.Warning, $"MQTT Relay Connection Error : {ex.Message}");
219+
Log(MTConnectLogLevel.Warning, $"MQTT Relay Connection Error : {exception.Message}");
221220

222-
var current = ex.InnerException;
221+
var innerException = exception.InnerException;
223222

224-
while( current != null )
223+
while (innerException != null)
225224
{
226-
Log(MTConnectLogLevel.Warning, $"MQTT Relay Connection Error (InnerException) : {current.Message}");
227-
current = current.InnerException;
225+
Log(MTConnectLogLevel.Warning, $"MQTT Relay Connection Error (InnerException) : {innerException.Message}");
226+
innerException = innerException.InnerException;
228227
}
229228

230-
Log(MTConnectLogLevel.Warning, $"MQTT Relay Connection Error (BaseException) : {ex.GetBaseException().ToString()}");
231-
232-
229+
Log(MTConnectLogLevel.Warning, $"MQTT Relay Connection Error (BaseException) : {exception.GetBaseException().ToString()}");
233230
}
234231
finally
235232
{

0 commit comments

Comments
 (0)