From 511f1ef882d594df64810d2c36b59ad381fd6e17 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Fri, 20 Nov 2026 07:23:42 -0500 Subject: Backport pull request #18048 from jellyfin/release-12.z Follow the Schedules Direct API contract when refreshing the guide Original-merge: 85fa90cb758dabfb434fbd00c1128091007cf6a4 Merged-by: Bond-009 Backported-by: Cody Robibero --- .../Net/HttpResponseBodyException.cs | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 MediaBrowser.Common/Net/HttpResponseBodyException.cs (limited to 'MediaBrowser.Common/Net/HttpResponseBodyException.cs') diff --git a/MediaBrowser.Common/Net/HttpResponseBodyException.cs b/MediaBrowser.Common/Net/HttpResponseBodyException.cs new file mode 100644 index 0000000000..2194640b61 --- /dev/null +++ b/MediaBrowser.Common/Net/HttpResponseBodyException.cs @@ -0,0 +1,31 @@ +using System.Net; +using System.Net.Http; + +namespace MediaBrowser.Common.Net; + +/// +/// An that retains the body of the failed response. +/// +/// +/// Providers report why they refused a request in the response body, which +/// discards. +/// +public class HttpResponseBodyException : HttpRequestException +{ + /// + /// Initializes a new instance of the class. + /// + /// The exception message. + /// The status code of the failed response. + /// The body of the failed response. + public HttpResponseBodyException(string message, HttpStatusCode? statusCode, string? responseBody) + : base(message, null, statusCode) + { + ResponseBody = responseBody; + } + + /// + /// Gets the body of the failed response. + /// + public string? ResponseBody { get; } +} -- cgit v1.2.3