Skip to content
Snippets Groups Projects
Commit 9f0e9cd0 authored by dgelessus's avatar dgelessus
Browse files

Refactor query truncation in result parser errors

parent c2a24c00
No related branches found
No related tags found
No related merge requests found
Pipeline #128877 passed
...@@ -162,11 +162,11 @@ public class AnimatorImpl { ...@@ -162,11 +162,11 @@ public class AnimatorImpl {
assert !(topnode instanceof ACallBackResult); assert !(topnode instanceof ACallBackResult);
if (!(topnode instanceof AYesResult)) { if (!(topnode instanceof AYesResult)) {
if (query.length() > 400) { String queryForMessage = query;
throw new ResultParserException("Prolog query failed - received " + topnode.getClass().getSimpleName() + " in response to query: " + query.substring(0, 400), null); if (queryForMessage.length() > 400) {
} else { queryForMessage = queryForMessage.substring(0, 400) + "...";
throw new ResultParserException("Prolog query failed - received " + topnode.getClass().getSimpleName() + " in response to query: " + query, null);
} }
throw new ResultParserException("Prolog query failed - received " + topnode.getClass().getSimpleName() + " in response to query: " + queryForMessage, null);
} }
bindings = BindingGenerator.createBinding(PrologTermGenerator.toPrologTerm(topnode)); bindings = BindingGenerator.createBinding(PrologTermGenerator.toPrologTerm(topnode));
} catch (ResultParserException e) { } catch (ResultParserException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment