Skip to content

Commit

Permalink
COH-31131 .NET: Don't print the whole exception stack trace in case o…
Browse files Browse the repository at this point in the history
…f Coherence connection failure

[git-p4: depot-paths = "//dev/main.net/": change = 112431]
  • Loading branch information
ecrivas committed Nov 15, 2024
1 parent 686ae3d commit d6c542e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/Coherence/Net/Impl/SafeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Threading;

using Tangosol.IO;
using Tangosol.Net.Messaging;
using Tangosol.Run.Xml;
using Tangosol.Util;
using Tangosol.Util.Daemon.QueueProcessor.Service;
Expand Down Expand Up @@ -993,9 +994,18 @@ protected virtual void StartService(Util.IService service)
}
catch (Exception e)
{
CacheFactory.Log("Error while starting service \""
+ ServiceName + "\": " + e,
CacheFactory.LogLevel.Error);
string message = "Error while starting service \"" + ServiceName + "\": ";
if (service is RemoteService && e is ConnectionException)
{
// COH-30321 - skip printing the stack trace as connection failures are common and the stack trace
// doesn't provide anything useful
CacheFactory.Log(message + e, CacheFactory.LogLevel.Error);
}
else
{
CacheFactory.Log(message + e.StackTrace, CacheFactory.LogLevel.Error);
}

try
{
service.Stop();
Expand Down

0 comments on commit d6c542e

Please sign in to comment.