Skip to content

Commit 0e1a0ba

Browse files
Remove unnecessary space added by CosmosException.ToString()
1 parent ff84695 commit 0e1a0ba

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosException.cs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ public override string StackTrace
141141
return this.stackTrace;
142142
}
143143
else
144-
{
145-
#pragma warning disable CDX1002 // DontUseExceptionStackTrace
146-
return base.StackTrace;
147-
#pragma warning restore CDX1002 // DontUseExceptionStackTrace
144+
{
145+
#pragma warning disable CDX1002 // DontUseExceptionStackTrace
146+
return base.StackTrace;
147+
#pragma warning restore CDX1002 // DontUseExceptionStackTrace
148148
}
149149
}
150150
}
@@ -181,7 +181,7 @@ public override string ToString()
181181
{
182182
StringBuilder stringBuilder = new StringBuilder();
183183
stringBuilder.Append(this.GetType().FullName);
184-
stringBuilder.Append(" : ");
184+
stringBuilder.Append(": ");
185185

186186
this.ToStringHelper(stringBuilder);
187187

@@ -198,7 +198,7 @@ internal ResponseMessage ToCosmosResponseMessage(RequestMessage request)
198198
trace: this.Trace);
199199

200200
return responseMessage;
201-
}
201+
}
202202

203203
private static string GetMessageHelper(
204204
HttpStatusCode statusCode,
@@ -262,24 +262,24 @@ private string ToStringHelper(
262262

263263
if (this.InnerException != null)
264264
{
265-
stringBuilder.Append(" ---> ");
266-
#pragma warning disable CDX1000 // DontConvertExceptionToObject
267-
stringBuilder.Append(this.InnerException);
268-
#pragma warning restore CDX1000 // DontConvertExceptionToObject
265+
stringBuilder.Append(" ---> ");
266+
#pragma warning disable CDX1000 // DontConvertExceptionToObject
267+
stringBuilder.Append(this.InnerException);
268+
#pragma warning restore CDX1000 // DontConvertExceptionToObject
269269
stringBuilder.AppendLine();
270270
stringBuilder.Append(" ");
271271
stringBuilder.Append("--- End of inner exception stack trace ---");
272272
stringBuilder.AppendLine();
273-
}
274-
275-
#pragma warning disable CDX1002 // DontUseExceptionStackTrace
273+
}
274+
275+
#pragma warning disable CDX1002 // DontUseExceptionStackTrace
276276
if (this.StackTrace != null)
277277
{
278278
stringBuilder.Append(this.StackTrace);
279279
stringBuilder.AppendLine();
280-
}
281-
#pragma warning restore CDX1002 // DontUseExceptionStackTrace
282-
280+
}
281+
#pragma warning restore CDX1002 // DontUseExceptionStackTrace
282+
283283
if (this.Diagnostics != null)
284284
{
285285
stringBuilder.Append("--- Cosmos Diagnostics ---");
@@ -307,17 +307,17 @@ internal static void RecordOtelAttributes(CosmosException exception, DiagnosticS
307307
{
308308
CosmosDbEventSource.RecordDiagnosticsForExceptions(exception.Diagnostics);
309309
}
310-
}
311-
312-
/// <summary>
313-
/// Creates a shallow copy of the current exception instance.
314-
/// This ensures that the cloned exception retains the same properties but does not
315-
/// excessively proliferate stack traces or deep-copy unnecessary objects.
316-
/// </summary>
317-
/// <returns>A shallow copy of the current <see cref="CosmosException"/>.</returns>
318-
public object Clone()
319-
{
320-
return this.MemberwiseClone();
321-
}
310+
}
311+
312+
/// <summary>
313+
/// Creates a shallow copy of the current exception instance.
314+
/// This ensures that the cloned exception retains the same properties but does not
315+
/// excessively proliferate stack traces or deep-copy unnecessary objects.
316+
/// </summary>
317+
/// <returns>A shallow copy of the current <see cref="CosmosException"/>.</returns>
318+
public object Clone()
319+
{
320+
return this.MemberwiseClone();
321+
}
322322
}
323323
}

0 commit comments

Comments
 (0)