Skip to content

Commit

Permalink
Add ShopifyHttpException constructor with nullable RequestInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
nozzlegear committed Apr 17, 2024
1 parent db9b9f3 commit 72d9aac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Expand Up @@ -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",
Expand Down
18 changes: 15 additions & 3 deletions ShopifySharp/Infrastructure/ShopifyHttpException.cs
Expand Up @@ -9,8 +9,8 @@ public class ShopifyHttpException(
ICollection<string> 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;
Expand All @@ -25,5 +25,17 @@ public class ShopifyHttpException(
public new readonly string? RequestId = requestId;

/// Extra details about the request, for logging purposes.
public readonly string? RequestInfo = requestInfo;
public readonly string? RequestInfo;

public ShopifyHttpException(
string requestInfo,
HttpStatusCode statusCode,
ICollection<string> errors,
string message,
string rawResponseBody,
string? requestId)
: this(statusCode, errors, message, rawResponseBody, requestId)
{
RequestInfo = requestInfo;
}
}

0 comments on commit 72d9aac

Please sign in to comment.