Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 21927 программистов и 1098 роботов. Сейчас ищут 708 программистов ...
Приступая к работе

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.

Пример #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";
}
?>

Пример #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 {
  
/* ... */
}
?>



Вернуться к: Примеры

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware