<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->

<refentry xml:id="stomp.error" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>Stomp::error</refname>
  <refname>stomp_error</refname>
  <refpurpose>Gets the last stomp error</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <para>&style.oop; (method):</para>
   <methodsynopsis>
   <modifier>public</modifier> <type>string</type><methodname>Stomp::error</methodname>
   <void />
   </methodsynopsis>
  <para>&style.procedural;:</para>
  <methodsynopsis>
   <type>string</type><methodname>stomp_error</methodname>
   <methodparam><type>resource</type><parameter>link</parameter></methodparam>
  </methodsynopsis>
  <para>
   Gets the last stomp error.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
     &stomp.param.link;
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns an error string or &false; if no error occurred.
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title>&style.oop;</title>
    <programlisting role="php">
<![CDATA[
<?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);

?>
]]>
     </programlisting>
     &example.outputs.similar;
     <screen>
<![CDATA[
bool(false)
string(43) "Invalid transaction id: unknown-transaction"
]]>
     </screen>
   </example>
  </para>
  <para>
   <example>
    <title>&style.procedural;</title>
    <programlisting role="php">
<![CDATA[
<?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);

?>
]]>
     </programlisting>
     &example.outputs.similar;
     <screen>  
<![CDATA[
bool(false)
string(43) "Invalid transaction id: unknown-transaction"
]]>  
     </screen>
   </example>
  </para>
 </refsect1>


</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
