Skip to content

Added more common errors #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 24, 2016
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 35 additions & 6 deletions discovery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,52 @@ Read more about setting up Puli in their `official documentation`_.
Common Errors
-------------

Could not find resource using any discovery strategy
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you get an error saying "*Could not find resource using any discovery strategy.*" it means that all the
discovery [#strategies]_ have failed. The cause of this is probably because you have not installed message factories
Copy link
Contributor

Choose a reason for hiding this comment

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

cause and because don't work in the same sentence afaik.

Most likely, your project is missing the message factories and/or a PRS-7 implementation.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe the "Too many autonumbered footnote references" error is because of [#strategies]_ - i am not sure what this would be but our other links use the format :ref:text ``

and/or a PSR-7 implementation. See the :doc:`user documentation <httplug/users>`.

To resolve this you may run

.. code-block:: bash

$ composer require php-http/curl-client guzzlehttp/psr7 php-http/message

Puli Factory is not available
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you get an error that says "*Puli Factory is not available*", it means that you have failed to install Puli.
You should make sure you install the latest version of ``puli/composer-plugin``.
Using Puli is optional and you will be able to use common clients and message factories without Puli
(:doc:`see how <httplug/users>`). If you want to use Puli, make sure to install the latest version of
``puli/composer-plugin``.

.. code-block:: bash

$ composer require puli/composer-plugin

No factories found
^^^^^^^^^^^^^^^^^^

The error "*No factories found. To use Guzzle or Diactoros factories install php-http/message and the chosen message implementation.*"
tells you that Puli could not find an installed implementation of PSR-7 and/or factories to that implementation. You
need to install those libraries. If you want to use Guzzle you may run:
The error "*No message factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message
and the chosen message implementation.*"
tells you that no discovery strategy could not find an installed implementation of PSR-7 and/or factories for that
Copy link
Member

Choose a reason for hiding this comment

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

could find

implementation. You need to install those libraries. If you want to use Guzzle you may run:

.. code-block:: bash

$ composer require php-http/message guzzlehttp/psr7

No HTTPlug clients found
^^^^^^^^^^^^^^^^^^^^^^^^

The error "No HTTPlug clients found. Make sure to install a package providing 'php-http/client-implementation'*" says that
Copy link
Contributor

Choose a reason for hiding this comment

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

To be consistent, you need to start with "* as well

Copy link
Member Author

Choose a reason for hiding this comment

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

I've missed that. Thank you

we cant find a client. See our :doc:`list of clients <clients>` and install one of them.
Copy link
Member

Choose a reason for hiding this comment

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

can't or cannot


.. code-block:: bash

$ composer require php-http/curl-client

HTTP Client Discovery
---------------------
Expand All @@ -118,7 +147,7 @@ This type of discovery finds an HTTP Client implementation::
protected $httpClient;

/**
* @param HttpClient|null $httpClient Client to do HTTP requests, if not set, autodiscovery will be used to find a HTTP client.
* @param HttpClient|null $httpClient Client to do HTTP requests, if not set, auto discovery will be used to find a HTTP client.
*/
public function __construct(HttpClient $httpClient = null)
{
Expand All @@ -142,7 +171,7 @@ This type of discovery finds a HTTP asynchronous Client implementation::
protected $httpAsyncClient;

/**
* @param HttpAsyncClient|null $httpAsyncClient Client to do HTTP requests, if not set, autodiscovery will be used to find an asynchronous client.
* @param HttpAsyncClient|null $httpAsyncClient Client to do HTTP requests, if not set, auto discovery will be used to find an asynchronous client.
*/
public function __construct(HttpAsyncClient $httpAsyncClient = null)
{
Expand Down