CurseForgeCommunity / .NET-APIClient

A CurseForge API Client (For CurseForge Core)
MIT License
12 stars 3 forks source link

Improvement of error handling #4

Closed caunt closed 4 days ago

caunt commented 1 month ago

Hello! First of all, I'd like to say thank you for such a great implementation of CurseForge API. I have just a few improvements ideas I'd like to see.

Recently, I started looking for Mod Files using ProjectId and FileId from Minecraft modpacks manifest.json file. Most of them was successfuly found, but some have missing files. I mean, mods being deleted from CurseForge. So ApiClient class have to throw not a very informative Exception about it, as CurseForge API response was 404 NotFound StatusCode. This messes up with many another http exceptions, where rate-limit gets applied or API key have been rejected.

I'd like to ask you just add some information about "bad" response being received. Split all types of CurseForge API exception to different classes, or at least, add a Message property to Exception, so we can identify Mods that cannot be found, or Rate Limit exception.

itssimple commented 1 month ago

Of course. It wasn't something I thought a lot about when I built this project, as I didn't know anyone else would use it. ^^

itssimple commented 4 days ago

Sorry for the delay, a lot of IRL stuff happening! But will fix this week!

itssimple commented 4 days ago

Fetching World of Warcraft (gameId 1)

image

Fetching gameId -1

image

itssimple commented 4 days ago

Version 3.0.0 uploaded to Nuget!