From 80e67ba8c1ae9ec26b4395c7ca716377ccb9a444 Mon Sep 17 00:00:00 2001 From: Michael Leuschel <leuschel@uni-duesseldorf.de> Date: Mon, 8 Jan 2024 16:44:36 +0100 Subject: [PATCH] try restrict size of query failed error dialogs Signed-off-by: Michael Leuschel <leuschel@uni-duesseldorf.de> --- de.prob.core/src/de/prob/core/internal/AnimatorImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/de.prob.core/src/de/prob/core/internal/AnimatorImpl.java b/de.prob.core/src/de/prob/core/internal/AnimatorImpl.java index 3b302ad1..29ff74fc 100644 --- a/de.prob.core/src/de/prob/core/internal/AnimatorImpl.java +++ b/de.prob.core/src/de/prob/core/internal/AnimatorImpl.java @@ -162,7 +162,11 @@ public class AnimatorImpl { assert !(topnode instanceof ACallBackResult); if (!(topnode instanceof AYesResult)) { - throw new ResultParserException("Prolog query failed - received " + topnode.getClass().getSimpleName() + " in response to query: " + query, null); + if (query.length() > 400) { + throw new ResultParserException("Prolog query failed - received " + topnode.getClass().getSimpleName() + " in response to query: " + query.substring(0, 400), null); + } else { + throw new ResultParserException("Prolog query failed - received " + topnode.getClass().getSimpleName() + " in response to query: " + query, null); + } } bindings = BindingGenerator.createBinding(PrologTermGenerator.toPrologTerm(topnode)); } catch (ResultParserException e) { -- GitLab