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

ARISA_REMOVE_CONTENT command error #786

Open
violine1101 opened this issue Jan 21, 2023 · 3 comments · Fixed by #828
Open

ARISA_REMOVE_CONTENT command error #786

violine1101 opened this issue Jan 21, 2023 · 3 comments · Fixed by #828
Labels
bug Something isn't working

Comments

@violine1101
Copy link
Member

The Bug

https://bugs.mojang.com/browse/MC-139135?focusedId=1232852&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1232852

java.lang.IllegalStateException: Can't overwrite cause with java.lang.RuntimeException: net.rcarz.jiraclient.JiraException: Failed to search issues
    at java.base/java.lang.Throwable.initCause(Throwable.java:463)
    at io.github.mojira.arisa.modules.commands.RemoveContentCommand.invoke(RemoveContentCommand.kt:79)
    at io.github.mojira.arisa.modules.commands.CommandDispatcherKt.getCommandDispatcher$lambda$24$lambda$21(CommandDispatcher.kt:320)
    at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:263)
    at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:177)
    at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:142)
    at io.github.mojira.arisa.modules.CommandModule$executeCommand$1$1.invokeSuspend(CommandModule.kt:75)
    at io.github.mojira.arisa.modules.CommandModule$executeCommand$1$1.invoke(CommandModule.kt)
    at io.github.mojira.arisa.modules.CommandModule$executeCommand$1$1.invoke(CommandModule.kt)
    at arrow.core.Either$Companion.catch(Either.kt:862)
    at arrow.core.Either$Companion.catch(Either.kt:858)
    at io.github.mojira.arisa.modules.CommandModule$executeCommand$1.invokeSuspend(CommandModule.kt:74)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    at io.github.mojira.arisa.modules.CommandModule.executeCommand(Com
@violine1101 violine1101 added the bug Something isn't working label Jan 21, 2023
@Marcono1234
Copy link
Contributor

I assume it might be my fault for suggesting to use initCause in #750 (comment). Apparently due to how Brigadier constructs the CommandSyntaxException it is not possible to set a cause afterwards.

We could at least change the initCause calls in ListUserActivityCommand.kt and RemoveContentCommand.kt to addSuppressed instead. Even if suppression for the CommandSyntaxException is disabled (which it currently isn't if I see that correctly), the call to addSuppressed would simply have no effect, but it would not throw an exception.

Or alternatively instead of throwing a CommandSyntaxException we throw our own exception where we can properly set a cause. But we would have to check whether that has any undesired side effects.

(I have not debugged this though, maybe the cause is a also a different one)

@violine1101
Copy link
Member Author

@violine1101
Copy link
Member Author

The PR likely only fixed the exception caused by the exception but not the exception itself; keeping open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants