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

Add runCatchingResponse #106

Closed
freya022 opened this issue Sep 24, 2023 · 0 comments
Closed

Add runCatchingResponse #106

freya022 opened this issue Sep 24, 2023 · 0 comments

Comments

@freya022
Copy link
Owner

This should allow users to run code which throws certain error responses

The top level function should return Result<Unit> as we cannot recover any data, extensions to Result<Unit> will "recover" the Result (suppress the exception), while still wanting to use Result#getOrThrow to notify the caller of unrelated exceptions

The goal would be to somewhat replicate JDA's ErrorHandler, typical use case is sending a DM, while handling/ignoring only CANNOT_SEND_TO_USER and rethrowing other exceptions/error responses

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

1 participant