Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(http): Http Error Codes as enum? #2752

Open
lukasfri opened this issue Feb 1, 2024 · 1 comment
Open

feat(http): Http Error Codes as enum? #2752

lukasfri opened this issue Feb 1, 2024 · 1 comment

Comments

@lukasfri
Copy link

lukasfri commented Feb 1, 2024

I searched through the issue tracker for issues linked to the error code field on the serenity::http::error::DiscordJsonError and couldn't find any, but this feels like an issue that should've come up, so I apologize if it has done so.

The error field feels it can be improved by either being replaced or supplemented by an enum that covers all currently existing error-codes, with (depending on implementation) either a variant or an Option for if the error-code is unknown.

A list from discords official docs is here:

https://github.com/discord/discord-api-docs/blob/main/docs/topics/Opcodes_and_Status_Codes.md

Would this be wanted? I could potentially implement it myself, with instructions of how the maintainers prefer such implementations.

@lukasfri lukasfri changed the title Http Error Codes as enum? feat(http): Http Error Codes as enum? Feb 1, 2024
@GnomedDev
Copy link
Member

This sounds like something that would be wanted, using the enum_number macro we have which will handle the unknown case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants