janssenr / SendCloudApi.Net

A C#/.net wrapper for the SendCloud API
MIT License
6 stars 5 forks source link

Issue when errors encounted #13

Closed davidkdb closed 2 years ago

davidkdb commented 2 years ago

Hi,

We had a big struggle to debug a problem with a shipment.

Using the GetShipments.

The value of shipping_method was null, but the error was triggered on the json parsing with a invalid value on int32 (but not which).

I downloaded the code, and found out by setting the shipping_method to int? it would not fail here, and by adding the errors properties these errors can actually be read.

This would be much more useful to show the user also. And another benefit would be that a shipment can actually be validated in the GetShipments with a list of validation errors.

I only made a change in the Shipment.cs

Should I upload it to here, or send it to you?

We would really like to use the "official" package, rather than fixing this locally ourselves.

janssenr commented 2 years ago

Hi,

You can upload it to here or send it to me.

davidkdb commented 2 years ago

Hi Rob,

Just sent you an email.

janssenr commented 2 years ago

Make ShippingMethodId nullable and Added Errors property to Shipment.cs