downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<ExamplesSAM Functions>
Last updated: Thu, 26 Jun 2008

Error handling

All SAMConnection methods that provide access to messaging operations return FALSE if an error occurred in processing the request. In addition the SAMConnection object has two properties, "errno" and "error", that provide respectively the error number and text description of the last error to occur on the connection.

Example #1 Handling an error from a method that returns no result

<?php
if (!$conn->commit()) {
  
// The commit failed!
  
echo "Commit failed ($conn->errno) $conn->error";
}
?>

Example #2 Handling an error from a method that returns a result

<?php
$correlid
= $conn->send('queue://send/test', $msg);

if (!
$correlid) {
 
// The Send failed!
 
echo "Send failed ($conn->errno) $conn->error";
} else {
  ...
}
?>



add a noteadd a note User Contributed Notes
Error handling
There are no user contributed notes for this page.




<ExamplesSAM Functions>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs