Skip to content

Ensure query error messages in popups are succinct #724

@aeisenberg

Description

@aeisenberg

Is your feature request related to a problem? Please describe.

When the query server throws an exception while running a query, it is easy to ignore or be unaware of it. In many cases, the query run still returns results, just not in the expected format. Users can be confused by this.

Exceptions are sent to the output log, but there is no notification that an error has occurred at all. If the user is not monitoring the output log, then they will not be aware that an error has occurred at all.

For example, running with invalid query metadata can send an exception like this to the console:

A fatal error occurred: Could not process query metadata.
Error was: No query kind specified(NO_KIND_SPECIFIED).
[2021-01-18 14:08:15] Exception caught at top level: Could not process query metadata.
                      Error was: No query kind specified(NO_KIND_SPECIFIED).
                      com.semmle.cli2.bqrs.InterpretCommand.executeSubcommand(InterpretCommand.java:123)
                      com.semmle.cli2.picocli.SubcommandCommon.executeWithParent(SubcommandCommon.java:414)
                      com.semmle.cli2.execute.CliServerCommand.lambda$executeSubcommand$0(CliServerCommand.java:67)
                      com.semmle.cli2.picocli.SubcommandMaker.runMain(SubcommandMaker.java:201)
                      com.semmle.cli2.execute.CliServerCommand.executeSubcommand(CliServerCommand.java:67)
                      com.semmle.cli2.picocli.SubcommandCommon.call(SubcommandCommon.java:430)
                      com.semmle.cli2.picocli.SubcommandMaker.runMain(SubcommandMaker.java:201)
                      com.semmle.cli2.picocli.SubcommandMaker.runMain(SubcommandMaker.java:209)
                      com.semmle.cli2.CodeQL.main(CodeQL.java:91)

Describe the solution you'd like

It would be useful if some relevant part of this message was put in a message dialog so that users would be aware that some unexpected behaviour occurred.

I imagine that we'd want to do some regex matching on messages coming in to find things that look like errors. If the regex matches, then we place that message (or part of the message) into a popup.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions