From dd73e0f9da6a7226c380a39e42b10f9f8fadd054 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Sat, 5 Oct 2024 13:05:23 +0200 Subject: [PATCH] Swallow all validator exceptions so the LSP server does not terminate when an exception is thrown during validation. Usually exceptions are only thrown, when the model is not well-formed, which will either be a syntactical error (will be displayed on the client), or another validation rule will find it. In either case, we can safely ignore all exceptions. --- .../mit/semantifyr/oxsts/lang/validation/OxstsValidator.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/validation/OxstsValidator.java b/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/validation/OxstsValidator.java index c9c0169..d102d77 100644 --- a/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/validation/OxstsValidator.java +++ b/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/validation/OxstsValidator.java @@ -20,6 +20,11 @@ public class OxstsValidator extends AbstractOxstsValidator { public static final String INVALID_INLINING = "invalidInlining"; public static final String INVALID_MULTIPLICITIY = "invalidMultiplicity"; + @Override + protected void handleExceptionDuringValidation(Throwable targetException) throws RuntimeException { + // swallow all exceptions! + } + @Check public void checkFeatureSubsetting(Feature feature) { if (feature.getSubsets().isEmpty()) return;