[JIRA] (JENKINS-62059) JabberIMConnectionProvider.createConnection() swallows Exceptions

11 views
Skip to first unread message

matthias.mueller@aiticon.com (JIRA)

unread,
Apr 27, 2020, 3:10:03 AM4/27/20
to jenkinsc...@googlegroups.com
Matthias Müller created an issue
 
Jenkins / Bug JENKINS-62059
JabberIMConnectionProvider.createConnection() swallows Exceptions
Issue Type: Bug Bug
Assignee: Florian Schmaus
Components: jabber-plugin
Created: 2020-04-27 07:09
Environment: jabber: 1.38
Labels: jabber
Priority: Minor Minor
Reporter: Matthias Müller

Hi Florian Schmaus,

this is a followup ticket to JENKINS-60193.
While I was trying to find out why my connection didn't work, I came across this issue.

When an XmppStringprepException occurs in JabberIMConnection(JabberPublisherDescriptor desc, AuthenticationHolder authentication), this exception is re-thrown as hudson.plugins.im.IMException.

But in JabberIMConnectionProvider.createConnection(), only RuntimeExceptions are getting caught.

So the log just tells me that the connection failed, but nut why it failed:

	h.p.j.i.t.JabberIMConnectionProvider#createConnection: Creating XMPP JabberIMConnection
	h.p.j.i.t.JabberIMConnectionProvider#createConnection: Connection failed

So IMHO here Exception}}s should get caught here, not only {{RuntimeException.

Regards
Matthias

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

matthias.mueller@aiticon.com (JIRA)

unread,
Apr 27, 2020, 3:12:03 AM4/27/20
to jenkinsc...@googlegroups.com
Matthias Müller updated an issue
Change By: Matthias Müller
Hi [~flow],


this is a followup ticket to JENKINS-60193.
While I was trying to find out why my connection didn't work, I came across this issue.

When an {{XmppStringprepException}} occurs in [JabberIMConnection(JabberPublisherDescriptor desc, AuthenticationHolder authentication)|https://github.com/jenkinsci/jabber-plugin/blob/1.38/src/main/java/hudson/plugins/jabber/im/transport/JabberIMConnection.java#L194], this exception is re-thrown as {{hudson.plugins.im.IMException}}.

But in [JabberIMConnectionProvider.createConnection()|https://github.com/jenkinsci/jabber-plugin/blob/1.38/src/main/java/hudson/plugins/jabber/im/transport/JabberIMConnectionProvider.java#L72], only RuntimeExceptions are getting caught.

So the log just tells me that the connection failed, but nut *why* it failed:
{code} h.p.j.i.t.JabberIMConnectionProvider#createConnection: Creating XMPP JabberIMConnection
h.p.j.i.t.JabberIMConnectionProvider#createConnection: Connection failed
{code}

So IMHO here {{Exception}}
s should get caught here, not only {{RuntimeException}}.

Regards
Matthias

flo@geekplace.eu (JIRA)

unread,
Apr 27, 2020, 3:42:02 AM4/27/20
to jenkinsc...@googlegroups.com
Florian Schmaus commented on Bug JENKINS-62059
 
Re: JabberIMConnectionProvider.createConnection() swallows Exceptions

I had argued that the try/catch should be removed completely and any kind of exception should be handled by higher layers. So the issue is actually that IMConnectionProvider.create() of the jabber-im plugin, silently swallows the exception.

flo@geekplace.eu (JIRA)

unread,
Apr 27, 2020, 5:13:02 AM4/27/20
to jenkinsc...@googlegroups.com

flo@geekplace.eu (JIRA)

unread,
Apr 27, 2020, 5:13:03 AM4/27/20
to jenkinsc...@googlegroups.com
Florian Schmaus updated an issue
Change By: Florian Schmaus
Hi [~flow],

this is a followup ticket to JENKINS-60193.
While I was trying to find out why my connection didn't work, I came across this issue.

When an {{XmppStringprepException}} occurs in [JabberIMConnection(JabberPublisherDescriptor desc, AuthenticationHolder authentication)|https://github.com/jenkinsci/jabber-plugin/blob/1.38/src/main/java/hudson/plugins/jabber/im/transport/JabberIMConnection.java#L194], this exception is re-thrown as {{hudson.plugins.im.IMException}}.

But in [JabberIMConnectionProvider.createConnection()|https://github.com/jenkinsci/jabber-plugin/blob/1.38/src/main/java/hudson/plugins/jabber/im/transport/JabberIMConnectionProvider.java#L72], only RuntimeExceptions are getting caught.

So the log just tells me that the connection failed, but nut *why* it failed:
{code :java }
h.p.j.i.t.JabberIMConnectionProvider#createConnection: Creating XMPP JabberIMConnection
h.p.j.i.t.JabberIMConnectionProvider#createConnection: Connection failed
{code}

So IMHO here {{Exception}} should get caught here, not only {{RuntimeException}}.

Regards
Matthias

flo@geekplace.eu (JIRA)

unread,
Apr 27, 2020, 5:13:06 AM4/27/20
to jenkinsc...@googlegroups.com
Florian Schmaus updated an issue
Change By: Florian Schmaus
Component/s: instant-messaging-plugin
Component/s: jabber-plugin

flo@geekplace.eu (JIRA)

unread,
Apr 27, 2020, 5:14:03 AM4/27/20
to jenkinsc...@googlegroups.com
Florian Schmaus started work on Bug JENKINS-62059
 
Change By: Florian Schmaus
Status: Open In Progress
Reply all
Reply to author
Forward
0 new messages