PHP Doku:: Gets the last stomp error - stomp.error.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSonstige DiensteStomp ClientThe Stomp classStomp::error -- stomp_error

Ein Service von Reinhard Neidl - Webprogrammierung.

The Stomp class

<<Stomp::__destruct -- stomp_close

Stomp::getReadTimeout -- stomp_get_read_timeout>>

Stomp::error

stomp_error

(PECL stomp >= 0.1.0)

Stomp::error -- stomp_errorGets the last stomp error

Beschreibung

Object oriented style (method):

public string Stomp::error ( void )

Procedural style:

string stomp_error ( resource $link )

Gets the last stomp error.

Parameter-Liste

link

Nur für prozedurale Aufrufe: Die Stomp-Verbindung, die von stomp_connect() zurückgegeben wurde.

Rückgabewerte

Returns an error string or FALSE if no error occurred.

Beispiele

Beispiel #1 Object oriented style

<?php

/* connection */
try {
    
$stomp = new Stomp('tcp://localhost:61613');
} catch(
StompException $e) {
    die(
'Connection failed: ' $e->getMessage());
}

var_dump($stomp->error());

if (!
$stomp->abort('unknown-transaction', array('receipt' => 'foo'))) {
    
var_dump($stomp->error());
}

/* close connection */
unset($stomp);

?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

bool(false)
string(43) "Invalid transaction id: unknown-transaction"

Beispiel #2 Procedural style

<?php

/* connection */
$link stomp_connect('ssl://localhost:61612');

/* check connection */
if (!$link) {
    die(
'Connection failed: ' stomp_connect_error());
}

var_dump(stomp_error($link));

if (!
stomp_abort($link'unknown-transaction', array('receipt' => 'foo'))) {
    
var_dump(stomp_error($link));
}

/* close connection */
stomp_close($link);

?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

bool(false)
string(43) "Invalid transaction id: unknown-transaction"


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)