repositories
/
TD_SR.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TD2: Be more informative at exception catching.
[TD_SR.git]
/
TD2
/
client
/
ThreadClientSend.java
diff --git
a/TD2/client/ThreadClientSend.java
b/TD2/client/ThreadClientSend.java
index 9d40e0d6a7effddb01cd3e585fc7a1db0caabd33..399cfd3139f819247e3a301fe9c88a52b0ed9724 100644
(file)
--- a/
TD2/client/ThreadClientSend.java
+++ b/
TD2/client/ThreadClientSend.java
@@
-12,28
+12,29
@@
public class ThreadClientSend implements Runnable {
try {
userInput = new BufferedReader(new InputStreamReader(System.in));
boolean end = false;
try {
userInput = new BufferedReader(new InputStreamReader(System.in));
boolean end = false;
-
while (!end) {
-
String line = userInput.readLine();
-
if (line.equals(".")) {
+ while (!end) {
+ String line = userInput.readLine();
+ if (line.equals(".")) {
end = true;
}
client.sendMsg(line);
System.out.println(Thread.currentThread().getName() + " a envoye " + line);
}
end = true;
}
client.sendMsg(line);
System.out.println(Thread.currentThread().getName() + " a envoye " + line);
}
-
}
+ }
catch (IOException e) {
System.err.println("IOException: " + e);
e.printStackTrace();
}
finally {
if (userInput != null) {
catch (IOException e) {
System.err.println("IOException: " + e);
e.printStackTrace();
}
finally {
if (userInput != null) {
- try {
- userInput.close();
- }
- catch (IOException e) {
- System.err.println("IOException: " + e);
- }
- }
+ try {
+ userInput.close();
+ }
+ catch (IOException e) {
+ System.err.println("IOException: " + e);
+ e.printStackTrace();
+ }
+ }
}
}
}
}
}
}