Skip to content

Commit

Permalink
Renamed Exception variables to better distinguish between them
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickRitchie committed Jun 26, 2024
1 parent 5c45a7b commit e2a518d
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,22 +214,19 @@ private async Task Worker()
await Task.Delay(100);
}
}
catch (Exception ex)
catch (Exception exception)
{

Log(MTConnectLogLevel.Warning, $"MQTT Relay Connection Error : {ex.Message}");
Log(MTConnectLogLevel.Warning, $"MQTT Relay Connection Error : {exception.Message}");

var current = ex.InnerException;
var innerException = exception.InnerException;

while( current != null )
while (innerException != null)
{
Log(MTConnectLogLevel.Warning, $"MQTT Relay Connection Error (InnerException) : {current.Message}");
current = current.InnerException;
Log(MTConnectLogLevel.Warning, $"MQTT Relay Connection Error (InnerException) : {innerException.Message}");
innerException = innerException.InnerException;
}

Log(MTConnectLogLevel.Warning, $"MQTT Relay Connection Error (BaseException) : {ex.GetBaseException().ToString()}");


Log(MTConnectLogLevel.Warning, $"MQTT Relay Connection Error (BaseException) : {exception.GetBaseException().ToString()}");
}
finally
{
Expand Down

0 comments on commit e2a518d

Please sign in to comment.