diff --git a/ShopifySharp.Tests/Infrastructure/ResponseClassifierTests.cs b/ShopifySharp.Tests/Infrastructure/ResponseClassifierTests.cs index 3ea18d885..857622fdc 100644 --- a/ShopifySharp.Tests/Infrastructure/ResponseClassifierTests.cs +++ b/ShopifySharp.Tests/Infrastructure/ResponseClassifierTests.cs @@ -142,7 +142,7 @@ private ShopifyRateLimitException CreateRateLimitException(ShopifyRateLimitReaso private ShopifyHttpException CreateHttpException(int statusCode) { - return new ShopifyHttpException(string.Empty, (HttpStatusCode)statusCode, + return new ShopifyHttpException((HttpStatusCode)statusCode, [], "some-exception-message", "some-raw-response-body", diff --git a/ShopifySharp/Infrastructure/ShopifyHttpException.cs b/ShopifySharp/Infrastructure/ShopifyHttpException.cs index 4006e033c..69ef0c177 100644 --- a/ShopifySharp/Infrastructure/ShopifyHttpException.cs +++ b/ShopifySharp/Infrastructure/ShopifyHttpException.cs @@ -5,13 +5,12 @@ namespace ShopifySharp.Infrastructure; public class ShopifyHttpException( - string requestInfo, HttpStatusCode statusCode, ICollection errors, string message, string rawResponseBody, - string? requestId -) : ShopifyException(statusCode, errors, message, rawResponseBody, requestId) + string? requestId) + : ShopifyException(statusCode, errors, message, rawResponseBody, requestId) { /// The Http response status code. public new readonly HttpStatusCode HttpStatusCode = statusCode; @@ -25,5 +24,18 @@ public class ShopifyHttpException( /// The X-Request-Id header returned by Shopify. This can be used when working with the Shopify support team to identify the failed request. public new readonly string? RequestId = requestId; - public readonly string RequestInfo = requestInfo; + /// Extra details about the request, for logging purposes. + public readonly string? RequestInfo; + + public ShopifyHttpException( + string requestInfo, + HttpStatusCode statusCode, + ICollection errors, + string message, + string rawResponseBody, + string? requestId) + : this(statusCode, errors, message, rawResponseBody, requestId) + { + RequestInfo = requestInfo; + } }