Added constructor to exception

This commit is contained in:
Niclas Finne 2012-05-23 15:03:03 +02:00
parent 4c1cff310c
commit d2c8cefa18
1 changed files with 3 additions and 3 deletions

View File

@ -126,7 +126,8 @@ public abstract class AbstractMspMoteType extends MspMoteType {
/* Handle multiple compilation commands one by one */
String[] arr = getCompileCommands().split("\n");
for (String cmd: arr) {
if (cmd.trim().isEmpty()) {
cmd = cmd.trim();
if (cmd.isEmpty()) {
continue;
}
@ -143,8 +144,7 @@ public abstract class AbstractMspMoteType extends MspMoteType {
);
} catch (Exception e) {
MoteTypeCreationException newException =
new MoteTypeCreationException("Mote type creation failed: " + e.getMessage());
newException = (MoteTypeCreationException) newException.initCause(e);
new MoteTypeCreationException("Mote type creation failed: " + e.getMessage(), e);
newException.setCompilationOutput(compilationOutput);
/* Print last 10 compilation errors to console */