XiaoFaye / WooCommerce.NET

A .NET Wrapper for WooCommerce/WordPress REST API
MIT License
391 stars 217 forks source link

Application Closes on error 404 #718

Closed aliajboy closed 1 year ago

aliajboy commented 1 year ago

Make sure you have included the below details when open an issue. Thank you.

richardaubin commented 1 year ago

Can you share your code that is causing the 404.

aliajboy commented 1 year ago

Simply, put order number that does not exist and get a 404 error. then program will close itself without showing any error. in debug mode you get webexception. thank you

richardaubin commented 1 year ago

wrap the call in a try catch block and handle the exception directly to prevent your app from crashing... Return an appropriate error message.

aliajboy commented 1 year ago

I did that but need some exact error if that Order number doesn't exist. this try catch will get active even on no network, because if user has no access to internet, WebException will happen and the catch that is for Order number will run again. I think an update is nice for that. tnx by the way

XiaoFaye commented 1 year ago

@aliajboy Try to check the Inner Exception of the exception you have catched.