question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Too many levels of error messages

See original GitHub issue

Prerequisites

Description

When running either the Merge Nodes, Merge Transactions, or Select Top N plugins when not all the information required for the plugin has been entered, you will receive error messages and a plugin exception. image Perhaps only the 3rd error window should appear or maybe a more meaningful window so that the user can understand what information they didn’t enter properly.

Steps to Reproduce

  1. Select one of the listed plugins
  2. Click the “Go” button

Expected behaviour: A window should appear explaining what information the user didn’t enter

Actual behaviour: 2 error windows and an exception appear

Reproduces how often: 100%

Additional Information

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
serpens24commented, Apr 17, 2020

I have reproduced this problem in the debugger to identify where/when these dialogs and exceptions are being thrown. They are:

  1. Within the exception handler of SimpleQueryPlugin.run() with a call to interaction.notify, this displays the longer of the two ‘Select Top N’ error dialog. (lines 173-179):
                    } catch (Exception e) {
                        final String msg = Bundle.MSG_Query_Failed(graph, getName());
                        interaction.notify(PluginNotificationLevel.ERROR, msg + "\n" + e.getMessage());
                        cancelled = true;
                        LOGGER.log(Level.WARNING, msg, e);
                        throw e;
                    }
  1. Within the exception handler of DefaultPluginEnvironment.executePluginLater(), this is actually a result of the ‘throw e’ propagating the exception up from SimpleQueryPlugin.run(), above. This results in the shorter of the two ‘Select Top N’ error dialogs.
            } catch (PluginException ex) {
                auditPluginError(plugin, ex);
                interaction.notify(ex.getNotificationLevel(), ex.getMessage());
                ex.printStackTrace();
                if (currentReport != null) {
                    currentReport.setError(ex);
                }
            }
  1. The bottom exception showing a stack trace is actually throwing inadvertantly as a result of the LOGGER.log(Level.WARNING, msg, e); call within the first code example above. Clearly this isn’t the desired outcome. I found that by removing the exception (e) as a final parameter still results in the LOGGER correctly logging the error to the error log, but without the exception being thrown. As the code currently exists, the following log extract is what is produced by the LOGGER call:
FINE [au.gov.asd.tac.constellation.plugins.PluginExecution]: Select Top N
INFO [au.gov.asd.tac.constellation.views.dataaccess.panes.DataAccessPane]: Plugins run.
Select Top N: Action failed: au.gov.asd.tac.constellation.graph.locking.DualGraph@757edcf4; Select Top N
Select a type category
WARNING [au.gov.asd.tac.constellation.plugins.templates.SimpleQueryPlugin]: Action failed: au.gov.asd.tac.constellation.graph.locking.DualGraph@757edcf4; Select Top N
au.gov.asd.tac.constellation.plugins.PluginException: Select a type category
	at au.gov.asd.tac.constellation.views.dataaccess.plugins.utility.SelectTopNPlugin.edit(SelectTopNPlugin.java:206)
	at au.gov.asd.tac.constellation.plugins.templates.SimpleQueryPlugin.describedEdit(SimpleQueryPlugin.java:265)
[catch] at au.gov.asd.tac.constellation.plugins.templates.SimpleQueryPlugin.run(SimpleQueryPlugin.java:165)
	at au.gov.asd.tac.constellation.graph.node.plugins.DefaultPluginEnvironment.lambda$executePluginLater$0(DefaultPluginEnvironment.java:123)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
SEVERE [au.gov.asd.tac.constellation.graph.node.plugins.DefaultPluginInteraction]: Select Top N: Select a type category
au.gov.asd.tac.constellation.plugins.PluginException: Select a type category
	at au.gov.asd.tac.constellation.views.dataaccess.plugins.utility.SelectTopNPlugin.edit(SelectTopNPlugin.java:206)
	at au.gov.asd.tac.constellation.plugins.templates.SimpleQueryPlugin.describedEdit(SimpleQueryPlugin.java:265)
	at au.gov.asd.tac.constellation.plugins.templates.SimpleQueryPlugin.run(SimpleQueryPlugin.java:165)
	at au.gov.asd.tac.constellation.graph.node.plugins.DefaultPluginEnvironment.lambda$executePluginLater$0(DefaultPluginEnvironment.java:123)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

By removing the ‘e’ from the call the following is what is produced by the LOGGER call:

INFO [au.gov.asd.tac.constellation.views.dataaccess.panes.DataAccessPane]: Plugins run.
Select Top N: Action failed: au.gov.asd.tac.constellation.graph.locking.DualGraph@d837407; Select Top N
Select a type category
WARNING [au.gov.asd.tac.constellation.plugins.templates.SimpleQueryPlugin]: Action failed: au.gov.asd.tac.constellation.graph.locking.DualGraph@d837407; Select Top N
SEVERE [au.gov.asd.tac.constellation.graph.node.plugins.DefaultPluginInteraction]: Select Top N: Select a type category
au.gov.asd.tac.constellation.plugins.PluginException: Select a type category
	at au.gov.asd.tac.constellation.views.dataaccess.plugins.utility.SelectTopNPlugin.edit(SelectTopNPlugin.java:206)
	at au.gov.asd.tac.constellation.plugins.templates.SimpleQueryPlugin.describedEdit(SimpleQueryPlugin.java:265)
	at au.gov.asd.tac.constellation.plugins.templates.SimpleQueryPlugin.run(SimpleQueryPlugin.java:165)
	at au.gov.asd.tac.constellation.graph.node.plugins.DefaultPluginEnvironment.lambda$executePluginLater$0(DefaultPluginEnvironment.java:123)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
1reaction
arcturus2commented, Feb 5, 2020

@formalhaut69 so I had this issue tracked in my internal issues list so I’ve just added to yours and updated the title…hope your ok with that 😄.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Messages: Examples, Best Practices & Common Mistakes
Designing error messages is all about limiting the frustration users feel with your form. If they're too stressed—too much cortisol builds ...
Read more >
A Complete Guide and List of HTTP Status Codes - Kinsta
Too many of these errors can also indicate that your site isn't of high quality, possibly lowering your rankings. 300-level codes have a...
Read more >
Best 10 Examples And Guidelines For Error Messages
Here are ten basic guidelines to help you create the most effective error messaging for your users. Click here to see all of...
Read more >
What's in a good error message? | Hacker News
Too many errors on one line (make fewer) ... Timestamp (in utc), log level, guid of the data being processed[1], log message, filename...
Read more >
Thoughtful Error Handling - Medium
Many different types of errors, such as buffer overflows, will dump memory for an attacker. More on buffer overflows later.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found