Fix file_get_contents when connection error occurs