scenerygraphics / sciview

sciview is a tool for visualization and interaction with ND image and mesh data
BSD 2-Clause "Simplified" License
67 stars 17 forks source link

SciJava Commands fail silently #494

Closed kephale closed 1 year ago

kephale commented 1 year ago

I've noticed this with a couple of bugs recently:

I'll ask @ctrueden for help when he gets the chance. This seems to be a general issue with running Commands and their exceptions not being shown.

kephale commented 1 year ago

I think one of the issues here is an example of a silently failing command: https://github.com/scenerygraphics/sciview/issues/438

moreApi commented 1 year ago

In https://github.com/scenerygraphics/sciview/issues/477 Curtis mentioned https://github.com/scijava/scijava-common/issues/452 as a cause for this issue

kephale commented 1 year ago

We could potentially catch these ourselves with this strategy: https://github.com/scijava/scijava-common/issues/452#issuecomment-1594719448

ctrueden commented 1 year ago

@kephale I'm happy to fix this at the SJC framework level, which would finally close scijava/scijava-common#452 properly, but I'd like your opinion on what you think should happen when a module errors:

  1. logService.error(exc)
  2. uiService.showDialog(exc.getMessage(), DialogPrompt.MessageType.ERROR_MESSAGE)
  3. Both
  4. Something else
kephale commented 1 year ago

1 would pull up the console and show the error? 2 would be prettier, but maybe 1 is sufficient and possibly less intrusive...

My vote is for consistency with Fiji (which I think might be 1?)

ctrueden commented 1 year ago

After digging into this issue again today for a while, I confirmed that the problem is actually already fixed, with the behavior of (1). However, when running in IntelliJ IDEA, it seems to be snarfing up the stderr and putting it only into its own log window, such that it no longer appears in the SciJava Console window. At least that's my theory. I'll be doing more testing tomorrow in an actual Fiji app outside of IntelliJ, so I'll be able to confirm for sure then. I'll wait to close this until I'm sure all is well, though.

ctrueden commented 1 year ago

All right, confirmed, scijava/scijava-common#459 does fix this issue. I forced a sciview command to throw a RuntimeException, and then I see it now on both the actual console and the in SciJava graphical console window. :+1: