mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-25 21:42:07 +01:00
Fix error handling in BOSHConnection
getCause() never throws. Not sure why the code was written that way. Thanks to CSH for reporting.
This commit is contained in:
parent
44a5408bc0
commit
9c8d7af3bf
1 changed files with 9 additions and 5 deletions
|
@ -590,13 +590,17 @@ public class BOSHConnection extends XMPPConnection {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (connEvent.isError()) {
|
if (connEvent.isError()) {
|
||||||
try {
|
// TODO Check why jbosh's getCause returns Throwable here. This is very
|
||||||
connEvent.getCause();
|
// unusual and should be avoided if possible
|
||||||
|
Throwable cause = connEvent.getCause();
|
||||||
|
Exception e;
|
||||||
|
if (cause instanceof Exception) {
|
||||||
|
e = (Exception) cause;
|
||||||
|
} else {
|
||||||
|
e = new Exception(cause);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
|
||||||
notifyConnectionError(e);
|
notifyConnectionError(e);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
connected = false;
|
connected = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue