Does spark deal with the socketException?

For example , I use spark as client and openfire as server, if I disable the computer’'s local connection or I stop the openfire server, I will throw a socketException: connection reset exception, Does spark catch this exception and deal with it?

if not, how can I catch this exception?