Skip to content
Snippets Groups Projects
Commit 56d3cd33 authored by leinolm's avatar leinolm
Browse files

poikkeuskäsittely ja konsolin nimeäminen

parent 972a4933
No related branches found
No related tags found
No related merge requests found
......@@ -39,8 +39,11 @@ public class ConsoleProcess extends Thread{
output.print("Cowhello>");
String syote = input.nextLine();
if (syote.equals("")) continue;
exec(syote);
try {
exec(syote);
} catch (Exception e) {
puhu(e,"Virhe komennon kanssa: "+e.getMessage());
}
}
}
......
......@@ -16,7 +16,7 @@ public class Cowhello {
System.out.println("testataan");
ConsoleProcess cp = new ConsoleProcess(System.in,System.out);
ConsoleProcess cp = new ConsoleProcess(System.in,System.out,"Cowhello");
TestProcess t = new TestProcess(cp);
t.start();
cp.lisaaKomento("hello", (o,arg) -> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment