Commit 3deffc68 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[GATE-70] Enhanced logging for exceptions.

[GATE-69] Yahoo failed logins are now being reported.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5512 b35dd754-fafc-0310-a699-88a17e54d16e
parent 398b7abd
......@@ -937,11 +937,11 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
roster.updateRosterItem(gwitem);
}
catch (UserAlreadyExistsException ee) {
Log.error("getRosterItem claims user exists, but couldn't find via getRosterItem?");
Log.error("getRosterItem claims user exists, but couldn't find via getRosterItem?", ee);
// TODO: Should we throw exception or something?
}
catch (Exception ee) {
Log.error("createRosterItem caused exception: " + ee.toString());
Log.error("Exception while creating roster item:", ee);
// TODO: Should we throw exception or something?
}
}
......@@ -1007,7 +1007,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
roster.deleteRosterItem(ri.getJid(), false);
}
catch (Exception e) {
Log.error("Error removing roster item: " + ri.toString());
Log.error("Error removing roster item: " + ri.toString(), e);
// TODO: Should we say something?
}
}
......@@ -1083,7 +1083,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
}
catch (UserNotFoundException e) {
// TODO: Something is quite wrong if we see this.
Log.error("Failed updating roster item");
Log.error("Failed updating roster item", e);
}
legacymap.remove(jid);
}
......@@ -1095,7 +1095,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
}
catch (UserNotFoundException e) {
// TODO: Something is quite wrong if we see this.
Log.error("Failed removing roster item");
Log.error("Failed removing roster item", e);
}
}
}
......@@ -1108,7 +1108,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
}
catch (UserNotFoundException e) {
// TODO: Something is quite wrong if we see this.
Log.error("Failed adding new roster item");
Log.error("Failed adding new roster item", e);
}
}
}
......@@ -1215,7 +1215,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
roster.deleteRosterItem(ri.getJid(), false);
}
catch (Exception e) {
Log.error("Error removing roster item: " + ri.toString());
Log.error("Error removing roster item: " + ri.toString(), e);
}
}
}
......
......@@ -144,7 +144,7 @@ public class PseudoRoster {
pseudoRosterItems.put(username, new PseudoRosterItem(registrationID, username));
}
catch (NotFoundException e) {
Log.error("Could not find pseudo roster item after already having found it.");
Log.error("Could not find pseudo roster item after already having found it.", e);
}
}
}
......
......@@ -97,7 +97,7 @@ public class IRCSession extends TransportSession {
conn.connect();
}
catch (IOException e) {
Log.error("IO error while connecting to IRC: "+e.toString());
Log.error("IO error while connecting to IRC: ", e);
}
}
......
......@@ -135,7 +135,7 @@ public class MSNSession extends TransportSession {
getTransport().syncLegacyRoster(getJID(), legacyusers);
}
catch (UserNotFoundException e) {
Log.error("Unable to sync MSN contact list for " + getJID());
Log.error("Unable to sync MSN contact list for " + getJID(), e);
}
// Lets send initial presence statuses
......
......@@ -390,7 +390,7 @@ public class OSCARSession extends TransportSession {
getTransport().syncLegacyRoster(getJID(), legacyusers);
}
catch (UserNotFoundException e) {
Log.error("Unable to sync oscar contact list for " + getJID());
Log.error("Unable to sync oscar contact list for " + getJID(), e);
}
updateStatus(this.presenceType, this.verboseStatus);
......
......@@ -19,6 +19,7 @@ import org.jivesoftware.wildfire.user.UserNotFoundException;
import org.jivesoftware.wildfire.roster.RosterItem;
import org.xmpp.packet.JID;
import org.xmpp.packet.Presence;
import org.xmpp.packet.Message;
import ymsg.network.LoginRefusedException;
import ymsg.network.Session;
import ymsg.network.YahooGroup;
......@@ -114,11 +115,26 @@ public class YahooSession extends TransportSession {
catch (LoginRefusedException e) {
yahooSession.reset();
Log.warn("Yahoo login failed for " + getJID());
Message m = new Message();
m.setType(Message.Type.error);
m.setTo(getJID());
m.setFrom(getTransport().getJID());
m.setBody("Failed to log into Yahoo! messenger account. (login refused)");
getTransport().sendPacket(m);
setLoginStatus(TransportLoginStatus.LOGGED_OUT);
}
catch (IOException e) {
Log.error("Yahoo login caused IO exception:", e);
Message m = new Message();
m.setType(Message.Type.error);
m.setTo(getJID());
m.setFrom(getTransport().getJID());
m.setBody("Failed to log into Yahoo! messenger account. (unknown error)");
getTransport().sendPacket(m);
setLoginStatus(TransportLoginStatus.LOGGED_OUT);
}
setLoginStatus(TransportLoginStatus.LOGGED_OUT);
}
}.run();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment