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

Allow CodeGenerationException to have a cause

parent 1f9400da
No related branches found
No related tags found
No related merge requests found
......@@ -344,8 +344,7 @@ public class CodeGenerator {
try {
project = Antlr4BParser.createBProjectFromMainMachineFile(path.toFile());
} catch (TypeErrorException | ScopeException e) {
e.printStackTrace();
throw new CodeGenerationException(e.getMessage());
throw new CodeGenerationException(e);
}
return project;
}
......@@ -355,8 +354,7 @@ public class CodeGenerator {
try {
project = VisBProjectParser.createVisBProjectFromMainFile(path.toFile(), visualisation);
} catch (TypeErrorException | ScopeException e) {
e.printStackTrace();
throw new CodeGenerationException(e.getMessage());
throw new CodeGenerationException(e);
}
return project;
}
......
......@@ -4,9 +4,15 @@ package de.hhu.stups.codegenerator.generators;
* Created by fabian on 31.05.18.
*/
public class CodeGenerationException extends RuntimeException {
public CodeGenerationException(String message, Throwable cause) {
super(message, cause);
}
public CodeGenerationException(String msg) {
super(msg);
public CodeGenerationException(String message) {
this(message, null);
}
public CodeGenerationException(Throwable cause) {
this(cause.getMessage(), cause);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment