Skip to content
Snippets Groups Projects
Commit 36c34faa authored by Michael Leuschel's avatar Michael Leuschel
Browse files

ensure we can load machines with only warnings


the user will see the warning dialog, but can then proceed
to animate the model

Signed-off-by: default avatarMichael Leuschel <leuschel@uni-duesseldorf.de>
parent ffdae063
No related branches found
No related tags found
No related merge requests found
Pipeline #151431 passed
/** /**
* (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, * (c) 2009-2025 Lehrstuhl fuer Softwaretechnik und Programmiersprachen,
* Heinrich Heine Universitaet Duesseldorf * Heinrich Heine Universitaet Duesseldorf
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */ * */
...@@ -61,14 +61,21 @@ public class ProblemHandler { ...@@ -61,14 +61,21 @@ public class ProblemHandler {
* *
* @param errors * @param errors
* The List of Error Messages from ProB * The List of Error Messages from ProB
* @param onlyWarnings
* A boolean which is true if only warnings occured
* @throws PrologException * @throws PrologException
*/ */
public static void raisePrologException(final List<String> errors, public static void raisePrologException(final List<String> errors,
final boolean onlyWarnings) throws PrologException { final boolean onlyWarnings) throws PrologException {
final String message = "ProB reported errors:\n" final String message = "ProB reported "
+ ((onlyWarnings) ? "warnings:\n" : "errors:\n")
+ String.join("\n", errors); + String.join("\n", errors);
Logger.notifyUser(message); Logger.notifyUser(message);
if (! onlyWarnings) {
throw new PrologException(message, onlyWarnings); throw new PrologException(message, onlyWarnings);
// if we throw the exception for warnings then the command will fail
// this will prevent e.g. animating machines with static check warnings
}
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment