Capture socket errors and print error message, not stack trace.