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