Files
jellyfin/MediaBrowser.Common/Net/HttpResponseBodyException.cs
T
Shadowghost 511f1ef882 Backport pull request #18048 from jellyfin/release-12.z
Follow the Schedules Direct API contract when refreshing the guide

Original-merge: 85fa90cb75

Merged-by: Bond-009 <bond.009@outlook.com>

Backported-by: Cody Robibero <cody@robibe.ro>
2026-11-20 07:23:42 -05:00

32 lines
1.1 KiB
C#

using System.Net;
using System.Net.Http;
namespace MediaBrowser.Common.Net;
/// <summary>
/// An <see cref="HttpRequestException"/> that retains the body of the failed response.
/// </summary>
/// <remarks>
/// Providers report why they refused a request in the response body, which
/// <see cref="HttpResponseMessage.EnsureSuccessStatusCode"/> discards.
/// </remarks>
public class HttpResponseBodyException : HttpRequestException
{
/// <summary>
/// Initializes a new instance of the <see cref="HttpResponseBodyException"/> class.
/// </summary>
/// <param name="message">The exception message.</param>
/// <param name="statusCode">The status code of the failed response.</param>
/// <param name="responseBody">The body of the failed response.</param>
public HttpResponseBodyException(string message, HttpStatusCode? statusCode, string? responseBody)
: base(message, null, statusCode)
{
ResponseBody = responseBody;
}
/// <summary>
/// Gets the body of the failed response.
/// </summary>
public string? ResponseBody { get; }
}