php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55702 AMQP Exception handling
Submitted: 2011-09-15 14:25 UTC Modified: 2015-04-26 21:02 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: peter dot colclough at toolstation dot com Assigned:
Status: Open Package: amqp (PECL)
PHP Version: 5.3.8 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-09-15 14:25 UTC] peter dot colclough at toolstation dot com
Description:
------------
AMQPExchangeException, and possibly others, do not supply the error code in $e->code, element. Only as a part of teh actual text message. 
This makes error trapping slightly complex, slow and horrible.

Test script:
---------------
try{
						  $this->oProdExchange->declare($sName, $npExchangeType); 
						  			}catch(AMQPExchangeException $e){
   $code = $e->getCode();     // $code = 0... always
}

Expected result:
----------------
If the exchange being used generates a:
[message:protected] => Server channel error: 406, message: PRECONDITION_FAILED...
I would expect:

[code:protected] => 406   Not [code:protected] => 0





Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-26 21:02 UTC] cmb@php.net
-Package: Unknown/Other Function +Package: amqp
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Nov 13 02:01:30 2019 UTC