Skip to content

Add docs for request error handling #96

@Fneufneu

Description

@Fneufneu

Examples miss a really important point: error handly for a request like a simple timeout.
simply like this:

$request = $client->request('GET', $url);
$request->on('error', function ($e) {
  $socketerror = $e->getPrevious();
  echo "request failed with error: " . $e->getMessage() . PHP_EOL;
});

I spend too much time just for this so i think it should be added in the README or the exemple section.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions