Skip to content

Commit

Permalink
better whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
fealebenpae committed Oct 9, 2023
1 parent 132479b commit a369366
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Realm/Realm/Native/SyncSocketProvider.WebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,21 +182,16 @@ public async void Dispose()

private static void FormatExceptionForLogging(Exception ex, StringBuilder builder, int nesting = 0)
{
for (int i = 0; i <= nesting; i++)
{
builder.Append('\t');
}
var indentation = new string('\t', nesting);
builder.Append(indentation);

builder.AppendFormat("{0}: {1}", ex.GetType().FullName, ex.Message);
builder.AppendLine();
if (Logger.LogLevel >= LogLevel.Trace && !string.IsNullOrEmpty(ex.StackTrace))
{
for (int i = 0; i <= nesting; i++)
{
builder.Append('\t');
}

builder.AppendLine(ex.StackTrace);
builder.Append(indentation);
var indentedTrace = ex.StackTrace.Replace(Environment.NewLine, Environment.NewLine + indentation);
builder.AppendLine(indentedTrace);
}

if (ex is AggregateException aggregateException)
Expand Down

0 comments on commit a369366

Please sign in to comment.