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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy