I가 다음 코드 골격예외 처리 모험
try {
...
...
sysout("Please provide an input: ");
Thread.sleep(10000); //10 secs time given to the user to give the input. If the user doesn't enter the input it is throwing the exception, which is not being handled (with the custom message)
interact(); //This is a method that belongs to **expectj.Spawn** class
...
...
} catch (Exception e) {
System.out.println("You have not given any input!Please try again!");
}
하지만 난 여전히 얻을 다음과 같은 출력 -
Exception in thread "ExpectJ Stream Piper" java.nio.channels.IllegalBlockingModeException
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:39)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:92)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:86)
at java.io.InputStream.read(InputStream.java:85)
at expectj.StreamPiper.run(StreamPiper.java:134)
내가 처리 할 필요가 예외의 다른 어떤 종류가 있습니까?
잡기와 동일한 스레드에서 예외가 발생 했습니까? – forsvarir
나는 그렇게 생각한다. 그러나 나는 확실하지 않다. – hari