downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SAM 関数> <配信/購読およびトピックの購読
Last updated: Fri, 13 Nov 2009

view this page in

エラー処理

SAMConnection のメソッドでメッセージング操作を行うものはすべて、 リクエスト処理中にエラーが発生すると FALSE を返します。 さらに SAMConnection オブジェクトはふたつのプロパティ "errno" および "error" を保持しています。これらはそれぞれ、 接続上でおこった最後のエラーのエラー番号およびエラー内容のテキストを表します。

例1 結果を返さないメソッドからのエラーの処理

<?php
if (!$conn->commit()) {
    
// コミットに失敗しました!
    
echo "Commit failed ($conn->errno$conn->error";
}
?>

例2 結果を返すメソッドからのエラーの処理

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

if (!
$correlid) {
  
// 送信に失敗しました!
  
echo "Send failed ($conn->errno$conn->error";
} else {
  
/* ... */
}
?>



add a note add a note User Contributed Notes
エラー処理
There are no user contributed notes for this page.

SAM 関数> <配信/購読およびトピックの購読
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites