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

GafferPopGraph execute method doesn't catch certain exceptions #3125

Closed
GCHQDeveloper314 opened this issue Nov 30, 2023 · 1 comment · Fixed by #3133
Closed

GafferPopGraph execute method doesn't catch certain exceptions #3125

GCHQDeveloper314 opened this issue Nov 30, 2023 · 1 comment · Fixed by #3133
Assignees
Labels
bug Confirmed or suspected bug tinkerpop Specific to/touches the tinkerpop module
Milestone

Comments

@GCHQDeveloper314
Copy link
Member

Describe the bug
When executing an Operation which is not supported, a java.lang.UnsupportedOperationException is thrown. This class is unrelated to the uk.gov.gchq.gaffer.operation.OperationException class which is caught by the GafferPopGraph catch clause.

These are the relevant lines:

try {
LOGGER.info("GafferPop operation chain called: " + opChain.toString());
return graph.execute(opChain, user);
} catch (final OperationException e) {
throw new RuntimeException(e);
}

This means that UnsupportedOperationException is not caught and handled as intended. The handling code could also be improved (e.g. log the error instead of just throwing).

To Reproduce
Steps to reproduce the behaviour:

  1. Add breakpoint in the above catch.
  2. Execute an Operation which is not supported by the configured store.
  3. Catch is not invoked as it should be.

Expected behaviour
All kinds of Exceptions encountered when executing Operation(s) should be handled.

Additional context
The snippet above is not tested. Tests should be added for this to ensure correct behaviour.

@GCHQDeveloper314 GCHQDeveloper314 added bug Confirmed or suspected bug tinkerpop Specific to/touches the tinkerpop module labels Nov 30, 2023
@GCHQDeveloper314 GCHQDeveloper314 added this to the v2.2.0 milestone Nov 30, 2023
@t92549
Copy link
Contributor

t92549 commented Dec 4, 2023

Generally, the testing of Store.doUnhandledOperation isn't great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed or suspected bug tinkerpop Specific to/touches the tinkerpop module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants