Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/Packages/Audience/Runtime/Transport/HttpTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,6 @@ private static async Task<int> ParseRejectedCount(HttpResponseMessage response)
}
}

// Cap the response-body excerpt the caller sees. Backends sometimes
// return verbose stack traces or HTML error pages; trimming keeps
// OnError consumers (loggers, UI) from being flooded.
private const int MaxErrorBodyChars = 500;

// Best-effort body extraction; null on read failure.
// Catches narrowed so OOM, OperationCanceledException, and ThreadAbortException
// propagate — body extraction must not mask process-level faults.
Expand All @@ -295,11 +290,7 @@ private static async Task<int> ParseRejectedCount(HttpResponseMessage response)
try
{
var body = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
if (string.IsNullOrWhiteSpace(body)) return null;
body = body.Trim();
return body.Length > MaxErrorBodyChars
? body.Substring(0, MaxErrorBodyChars) + "…"
: body;
return string.IsNullOrWhiteSpace(body) ? null : body.Trim();
}
catch (HttpRequestException) { return null; }
catch (IOException) { return null; }
Expand Down
Loading