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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
25 - 15 = ?
Subscribe to this entry?

 
 [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
 [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-2021 The PHP Group
All rights reserved.
Last updated: Tue Sep 28 15:03:36 2021 UTC