ins0 / ins0/google-measurement-php-client

When Internet is not available socket_connect throws a 'Host name lookup failure' PHP error

Open
#34 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
51
Forks
23
PR merge metrics
No merged PRs in 30d

Description

In no Internet available condition, the socket_connect call in Socket.php createConnection function throws the following error:

> A PHP Error was encountered
> Servetity: Warning
>
> Message: socket_connect(): Host loockup failed [-10002]: Host name lookup failure
> Filename: Adapter/Socket.php
>
> Line Number: 32
>
> Backtrace:
> [...]

that ignoring the possible false return, and any exception throwing and try&catch.

Is there any way to avoid that error message in that specific call?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in Adapter/Socket.php at the createConnection function and the socket_connect call around line 32. Trace how a failed connection is handled when Internet access is unavailable; done means the expected connection failure is handled without emitting the PHP warning shown in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.