1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-23 08:32:39 +00:00

Improved error when emulator cannot be found. Closes #506

This commit is contained in:
jespergravgaard 2020-11-08 13:02:07 +01:00
parent 66d94d7501
commit bca3622d55

View File

@ -463,12 +463,14 @@ public class KickC implements Callable<Integer> {
CharToPetsciiConverter.setCurrentEncoding("screencode_mixed"); CharToPetsciiConverter.setCurrentEncoding("screencode_mixed");
kasmResult = KickAssembler65CE02.main2(assembleCommand.toArray(new String[0])); kasmResult = KickAssembler65CE02.main2(assembleCommand.toArray(new String[0]));
} catch(Throwable e) { } catch(Throwable e) {
throw new CompileError("KickAssembling file failed! ", e); System.err.println("KickAssembling file failed! "+e.getMessage());
return COMPILE_ERROR;
} finally { } finally {
System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out))); System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));
} }
if(kasmResult != 0) { if(kasmResult != 0) {
throw new CompileError("KickAssembling file failed! " + kasmLogOutputStream.toString()); System.err.println("KickAssembling file failed! " + kasmLogOutputStream.toString());
return COMPILE_ERROR;
} }
} }
@ -491,8 +493,13 @@ public class KickC implements Callable<Integer> {
if(verbose) { if(verbose) {
System.out.println("Executing command: " + executeCommand); System.out.println("Executing command: " + executeCommand);
} }
Process process = Runtime.getRuntime().exec(executeCommand); try {
process.waitFor(); Process process = Runtime.getRuntime().exec(executeCommand);
process.waitFor();
} catch(Throwable e) {
System.err.println("Executing emulator failed! "+e.getMessage());
return COMPILE_ERROR;
}
} }
} }