php-doc-en/reference/intl/dateformatter/get-error-message.xml
Máté Kocsis ce46b05403 Generate intl methodsynopses - IntlDateFormatter
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-340.
2021-02-13 16:47:02 +01:00

143 lines
3.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="intldateformatter.geterrormessage" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>IntlDateFormatter::getErrorMessage</refname>
<refname>datefmt_get_error_message</refname>
<refpurpose>Get the error text from the last operation</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<para>
&style.oop;
</para>
<methodsynopsis role="oop">
<modifier>public</modifier> <type>string</type><methodname>IntlDateFormatter::getErrorMessage</methodname>
<void/>
</methodsynopsis>
<para>
&style.procedural;
</para>
<methodsynopsis role="procedural">
<type>string</type><methodname>datefmt_get_error_message</methodname>
<methodparam><type>IntlDateFormatter</type><parameter>formatter</parameter></methodparam>
</methodsynopsis>
<para>
Get the error text from the last operation.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>formatter</parameter></term>
<listitem>
<para>
The formatter resource.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Description of the last error.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>datefmt_get_error_message</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$fmt = datefmt_create(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);
$str = datefmt_format($fmt);
if (!$str) {
printf(
"ERROR: %s (%d)\n",
datefmt_get_error_message($fmt),
datefmt_get_error_code($fmt)
);
}
?>
]]>
</programlisting>
</example>
<example>
<title>OO example</title>
<programlisting role="php">
<![CDATA[
<?php
$fmt = new IntlDateFormatter(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);
$str = $fmt->format();
if(!$str) {
printf(
"ERROR: %s (%d)\n",
$fmt->getErrorMessage(),
$fmt->getErrorCode()
);
}
?>
]]>
</programlisting>
</example>
&example.outputs;
<screen>
<![CDATA[
ERROR: U_ZERO_ERROR (0)
]]>
</screen>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>datefmt_get_error_code</function></member>
<member><function>intl_get_error_code</function></member>
<member><function>intl_is_failure</function></member>
</simplelist>
</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
-->