Discord-Net-Labs / Discord.Net-Labs

An experimental fork of Discord.Net that implements the newest discord features for testing and development to eventually get merged into Discord.Net
https://labs.discordnet.dev
MIT License
156 stars 42 forks source link

Implement Better Discord Errors #291

Closed quinchs closed 2 years ago

quinchs commented 2 years ago

Summary

This PR implements parsing of the JSON error messages received by discord, it also deprecates ApplicationCommandException as this is no longer needed.

This PR makes major changes to the HttpException including:

The DiscordErrorCode enum is kept up to date with the Official docs, it contains all the error codes and is parsed thru the request bucket.

The DiscordJsonError class contains a path of the json as well as a string message and code that tells the executer what went wrong with the request.

SylveonDeko commented 2 years ago

Fun