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: 2021-06-10 15:33 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: cmb (profile)
Status: Closed Package: amqp (PECL)
PHP Version: 5.3.8 OS: Linux
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: peter dot colclough at toolstation dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-26 21:02 UTC] cmb@php.net
-Package: Unknown/Other Function +Package: amqp
 [2021-06-10 15:33 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-06-10 15:33 UTC] cmb@php.net
The amqp bug tracker is now on Github[1].  If this is still an
issue, please report there.

[1] <https://github.com/php-amqp/php-amqp/issues>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 15:01:27 2025 UTC