Better error display for `ConnectionException`

Most of the SmackException error messages are useful and short, however the ConnectionException message contains a list of all host failures, which each might contain a list of DNS failures, which then…

Edit: image embedding is broken for $reasons, direct link to image: https://op-co.de:5281/upload/taWz_q4oIVlVkjGz/Screenshot_20181201-095957_yaxim.jpg

I know that making good error messages is a science, and I’d like to have a one-liner that’s usable for debugging (screnshot sent to server admin). I’m thinking of something like the host/ip address and exception of the most recent attempt.

Currently I need to do something like this:

if (reason instanceof SmackException.ConnectionException)
	reason = ((SmackException.ConnectionException)reason).getFailedAddresses()
		.get(0).getExceptions().values().iterator().next();

For bug reports, and for debugging in general, you usually want as much information as possible. I do not think that it is sensible that the library only reports one Exception when there where in fact multiple. Allowing your bug reporting framework to gather coherent information.

What you show the user is a completely different topic.

Ultimately I am not sure what you concretely propose. A convince method which transforms connection exceptions to end user comprehensible messages? I would not be opposed to that, but you are entering i18n terrain here, which could make things tricky.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.