-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from bivashy/fix/195-vk-messengerexceptionhan…
…dler-shouldnt-reply-to-commandactor-if-error-occurs [Fix] Ignore ApiMessagesDenySendException in VK link
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
core/src/main/java/me/mastercapexd/auth/vk/command/exception/VKExceptionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package me.mastercapexd.auth.vk.command.exception; | ||
|
||
import com.bivashy.auth.api.link.LinkType; | ||
import com.vk.api.sdk.exceptions.ApiMessagesDenySendException; | ||
import me.mastercapexd.auth.messenger.commands.exception.MessengerExceptionHandler; | ||
import revxrsal.commands.command.CommandActor; | ||
|
||
public class VKExceptionHandler extends MessengerExceptionHandler { | ||
|
||
public VKExceptionHandler(LinkType linkType) { | ||
super(linkType); | ||
} | ||
|
||
@Override | ||
public void onUnhandledException(CommandActor actor, Throwable throwable) { | ||
if (throwable instanceof ApiMessagesDenySendException) | ||
return; | ||
super.onUnhandledException(actor, throwable); | ||
} | ||
|
||
} |