mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-30 04:42:24 +02:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@147508 c90b9560-bf6c-de11-be94-00142212c4b1
84 lines
2.5 KiB
XML
84 lines
2.5 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- splitted from ./fr/functions/errorfunc.xml, last change in rev 1.10 -->
|
|
<!-- last change to 'trigger-error' in en/ tree in rev 1.1 -->
|
|
<refentry id="function.trigger-error">
|
|
<refnamediv>
|
|
<refname>trigger_error</refname>
|
|
<refpurpose>
|
|
Déclenche une erreur utilisateur
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>void</type><methodname>trigger_error</methodname>
|
|
<methodparam><type>string</type><parameter>error_msg</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>error_type</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>trigger_error</function> est utilisé pour déclencher
|
|
une erreur utilisateur. Elle peut aussi être utilisée en
|
|
conjonction avec un gestionnaire d'erreur interne, ou un gestionnaire
|
|
d'erreurs utilisateur qui a été choisi comme gestionnaire
|
|
d'erreur avec <function>set_error_handler</function>.
|
|
</para>
|
|
<para>
|
|
<function>trigger_error</function> est pratique lorsque vous devez
|
|
générer une réponse particulière lors de
|
|
l'exécution. Par exemple :
|
|
<example>
|
|
<title>Exemple avec <function>trigger_error</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
if (assert ($divisor == 0))
|
|
trigger_error ("Impossible de diviser par zéro", E_USER_ERROR);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<note>
|
|
<para>
|
|
Voyez <function>set_error_handler</function> pour une illustration.
|
|
</para>
|
|
</note>
|
|
<note>
|
|
<para>
|
|
<parameter>error_msg</parameter> est limité à 1024 caractères
|
|
en longueur. Tous les caractères supplémentaires seront
|
|
ignorés.
|
|
</para>
|
|
</note>
|
|
</para>
|
|
<para>
|
|
Voir aussi
|
|
<function>error_reporting</function>,
|
|
<function>set_error_handler</function>,
|
|
<function>restore_error_handler</function> et
|
|
<link linkend="errorfunc.constants">les constantes de niveau
|
|
d'erreurs</link>.
|
|
</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:"../../../../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
|
|
-->
|