Skip to content

Timeout and error handling#73

Open
phmLabs wants to merge 2 commits intobeberlei:3.xfrom
leankoala-gmbh:master
Open

Timeout and error handling#73
phmLabs wants to merge 2 commits intobeberlei:3.xfrom
leankoala-gmbh:master

Conversation

@phmLabs
Copy link

@phmLabs phmLabs commented Jun 20, 2019

We needed a fsocket connection timeout that is shorter than the default value. Additionally, we have to know if an error occurred storing the metric.

if (!$fp) {
return;
}
$fp = @fsockopen($this->protocol . '://' . $this->host, $this->port, $errno, $errmsg, $this->timeout);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using @ is a bad idea. Could you use a custom error handler?
see this example: https://github.com/redirectionio/proxy-sdk-php/blob/master/src/Client.php#L231-L251

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants