Skip to content
Snippets Groups Projects
Commit 1398231d authored by Daniel Plagge's avatar Daniel Plagge
Browse files

Converting RuntimeExceptions to TranslationFailedExceptions,

because the latter failed silently on export to classical ProB
parent 891f45b3
Branches
Tags
No related merge requests found
......@@ -33,7 +33,8 @@ public class TranslatorFactory {
*/
public static void translate(final IEventBRoot root,
final IPrologTermOutput pto) throws TranslationFailedException {
final String componentName = root.getComponentName();
try {
if (root instanceof IMachineRoot) {
final ISCMachineRoot scRoot = ((IMachineRoot) root)
.getSCMachineRoot();
......@@ -44,10 +45,14 @@ public class TranslatorFactory {
.getSCContextRoot();
EventBContextTranslator.create(scRoot, pto);
} else {
throw new TranslationFailedException(root.getComponentName(),
throw new TranslationFailedException(componentName,
"Cannot translate anything else than IMachineRoot or IContextRoot. Type was: "
+ root.getClass());
}
} catch (RuntimeException e) {
throw new TranslationFailedException(componentName,
"A runtime exception occurred: " + e.getMessage(), e);
}
}
public static void translate(final IEventBRoot root,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment