Red error messages when copy&paste code into the Script Editor

Hi @ctrueden,

I’m coming back to you as you offered helping the Fiji community in reducing the red error messages and stack traces popping up. So here comes one:

When you copy&paste code from IntelliJ to the script editor (into a macro btw), somtimes, this error pops up:

Exception "java.lang.ClassNotFoundException: com/intellij/codeInsight/editorActions/FoldingData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.FoldingData

I could imagine it is thrown in an external dependency, but maybe we can catch it somewhere?

I was furthermore wondering, if it might be possible to show these error messages a bit less offensive than by opening the Console Window. Is it maybe possible to show that an error happened in Fijis status bar and opening the console if someone clicks on that error?
I think MicroManager has a similar solution built-in. Maybe @nicost can point us to where in the code this is implemented in MM and we take over such a solution for errors/warnings in general?

Thanks!

Cheers,
Robert

It’s an issue with core Java + IntelliJ. Here’s an explanation:

Next step would be to try putting a try/catch around any Toolkit clipboard calls. But it might be that something is caught internally in Java and then barfed to stderr; in that case, we’ll need to add a SciJava stderr listener that filters these messages. The SciJava console logic probably needs only a small improvement to support extensible filtering in this way.

We want users to report bugs when they happen. A big red stack trace is always a bug. Hiding the traces behind an unobtrusive icon would deter users from reporting these bugs.

What would be wonderful would be to finish the new bug reporter. It could intercept stack traces to stderr and open a friendlier window encouraging users to submit the bug to GitHub to the appropriate repository. This is a project I’d like to complete in late 2020 or first half 2021.

1 Like

I can’t find Toolkit clipboard related stuff in the script editor repository. 1 2

We may need to do this in the RSyntaxTextArea repository… Or do you see any way of doing this on our side?

Can you point us to the code and/or open todos for this? I couldn’t find any “reporter” or similar repos in ImageJ, Fiji or SciJava.

Thanks!

Cheers,
Robert

and this open issue on imagej/imagej:

2 Likes