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 ErrorResponseException.ignore(...) #1129

Merged
merged 2 commits into from
Nov 17, 2019

Conversation

MinnDevelopment
Copy link
Member

Pull Request Etiquette

Changes

  • Internal code
  • Library interface (affecting end-user code)
  • Documentation
  • Other: _____

Closes Issue: NaN

Description

This allows to ignore specific error responses without a complicated piece of code.

Example

public static void selfDestruct(MessageChannel channel, String content) {
    channel.sendMessage(content).queue((message) -> 
        message.delete().queueAfter(30, SECONDS, null, ignore(UNKNOWN_MESSAGE))
    );
}

This allows to ignore specific error responses without
a complicated piece of code
@Andre601
Copy link
Contributor

Andre601 commented Nov 2, 2019

That's actually quite handy since I myself have the issue of constantly receiving "RestAction returned failure ....: Unknown Message" even tho I do everything to make sure the message is known (Check if message is null, make sure bot has message history perms before performing actions, etc)
So this would (at least) clean the console a bit.

@MinnDevelopment MinnDevelopment merged commit 4ba0c61 into development Nov 17, 2019
@MinnDevelopment MinnDevelopment deleted the feature/ignore-error-responses branch November 17, 2019 05:06
@MinnDevelopment MinnDevelopment added this to the v4.1.0 milestone Nov 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants