Closed nozzlegear closed 7 months ago
This will be an issue for us as we use the properties that you have deprecated. Specifically HttpStatusCode and RequestId and RawBody
@clement911 Understood, hopefully this won't be the case. My intent wasn't to get rid of those properties entirely! They're still available on the new ShopifyHttpException class where I plan to keep them. Anywhere you use the ShopifyException class with the three deprecated properties, you should be able to switch it to ShopifyHttpException and the deprecation warnings will disappear.
My intent is that the base ShopifyException is thrown for things like configuration errors; ShopifyHttpException is thrown for errors that occur with http requests and error responses from Shopify; and ShopifyRateLimitException is thrown when hitting the rate limit.
Does that make sense?
Oh I see, that should be fine then.
Although I see that ShopifyHttpException
is under the ShopifySharp.Infrastructure
. Personally I'd prefer to have a single ShopifySharp
namespace.
Oh woops, I don't think I meant to put it there. Might have been Rider sneaking that in. I'll change it!
This pull request does a light bit of refactoring on ShopifySharp's exceptions:
ShopifyHttpException
, which inherits from the baseShopifyException
. This new exception should be thrown whenever an http request fails or returns an error.ShopifyRateLimitException
inherit from theShopifyHttpException
.ShopifyException
:HttpStatusCode
RequestId
Errors
RawBody
ShopifyException.HttpResponse
property.ShopifyService
,GraphService
andPartnerService
classes to throw aShopifyHttpException
where applicable.ShopifyException.Errors
string list in some cases. This error message was an exact duplicate of the exception's message.