More accurate error messages for socket failures.