php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60950 Missing exceptions on ($HttpRequest)->send()
Submitted: 2012-02-01 20:05 UTC Modified: 2015-06-16 07:42 UTC
Votes:5
Avg. Score:4.8 ± 0.4
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:2 (40.0%)
From: sumariva at gmail dot com Assigned:
Status: Wont fix Package: pecl_http (PECL)
PHP Version: 5.3.9 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sumariva at gmail dot com
New email:
PHP Version: OS:

 

 [2012-02-01 20:05 UTC] sumariva at gmail dot com
Description:
------------
Hello I got the following exception launched on method ($HttpRequest)->send():
HttpInvalidParamException .
But this is not listed on current documentation.

Also the exception parent class HttpException is missing on docs.
Could you add the exception related classes to the Http package documentation.

That would be nice for first users of this package.



Test script:
---------------
# point to some url that will not response #
$req = new HttpRequest(
        "http://anyurl-that-will-timeout"
       ,HttpRequest::METH_GET
);

$req->send();



Expected result:
----------------
An exception from the listed ones on documentation.

Actual result:
--------------
Fatal error: Uncaught exception 'HttpInvalidParamException' with message 'Empty or too short HTTP message: '''

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-19 00:05 UTC] ehalls at gmail dot com
~Also have this issue for v1.7.4 and php 5.4.

Exception handling within the response class I presume.
 [2012-08-17 05:14 UTC] kilbyc at bellsouth dot net
I have this same complaint. The caught error is not clearly documented, and the actual important error is in HttpException->innerException which is not documented anywhere.
I found this:
http://www.mkfoster.com/2009/01/06/how-to-pecl-http-request-exception-and-error-handling/
It is now my standard reference for using HttpRequest.
 [2015-06-16 07:42 UTC] mike@php.net
-Status: Open +Status: Wont fix
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 05:01:26 2019 UTC