cvs: phpdoc-es /reference/errorfunc/functions trigger-error.xml

From: Date: Thu, 20 Jan 2005 17:37:23 +0000
Subject: cvs: phpdoc-es /reference/errorfunc/functions trigger-error.xml
Groups: php.doc.es 
Request: Send a blank email to doc-es+get-739@lists.php.net to get a copy of this message
javi Thu Jan 20 12:37:23 2005 EDT Modified files: /phpdoc-es/reference/errorfunc/functions trigger-error.xml Log: Traducida por primera vez http://cvs.php.net/diff.php/phpdoc-es/reference/errorfunc/functions/trigger-error.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/errorfunc/functions/trigger-error.xml diff -u phpdoc-es/reference/errorfunc/functions/trigger-error.xml:1.1 phpdoc-es/reference/errorfunc/functions/trigger-error.xml:1.2 --- phpdoc-es/reference/errorfunc/functions/trigger-error.xml:1.1 Sun Apr 14 20:13:40 2002 +++ phpdoc-es/reference/errorfunc/functions/trigger-error.xml Thu Jan 20 12:37:23 2005 @@ -1,44 +1,56 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./es/functions/errorfunc.xml, last change in rev 1.1 --> <!-- last change to 'trigger-error' in en/ tree in rev 1.1 --> - <refentry id="function.trigger-error"> +<refentry id="function.trigger-error"> <refnamediv> <refname>trigger_error</refname> <refpurpose> - Generates a user-level error/warning/notice message + Genera un mensaje de error/aviso/notificaci&oacute;n a nivel de usuario </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + &reftitle.description; <methodsynopsis> - <type>void</type><methodname>trigger_error</methodname> + <type>bool</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> - Used to trigger a user error condition, it can be used by in conjunction - with the built-in error handler, or with a user defined function that has - been set as the new error handler - (<function>set_error_handler</function>). This function is useful when - you need to generate a particular response to an exception at runtime. - For example: + Esta funci&oacute;n se utiliza generalmente para lanzar mensajes de error. Se puede usar + junto con el manejador de errores interno de PHP o con funciones manejadoras de error creadas + por el usuario (<function>set_error_handler</function>). Solamente funciona con la familia de + constantes E_USER y por defecto lo har&aacute; con <constant>E_USER_NOTICE</constant>. + </para> + <para> + El valor devuelto ser&aacute; &false; si se especifica un valor de <parameter>error_type</parameter> incorrecto y &true; en cualquier otro caso. + </para> + <para> + La mayor utilidad de esta funci&oacute;n es la de generar respuestas personalizadas a las excepciones en tiempo de ejecuci&oacute;n. + Por ejemplo: <informalexample> - <programlisting> -if (assert ($divisor == 0)) - trigger_error ("Cannot divide by zero", E_USER_ERROR); + <programlisting role="php"> +<![CDATA[ +<?php +if (assert($divisor == 0)) { + trigger_error("Cannot divide by zero", E_USER_ERROR); +} +?> +]]> </programlisting> </informalexample> <note> - <para> - See <function>set_error_handler</function> for a more extensive example. - </para> + <para> + Puede consultar la funci&oacute;n <function>set_error_handler</function> para ver un ejemplo m&acute;s extenso. + </para> + </note> + <note> + <para> + El par&aacute;metro <parameter>error_msg</parameter> tiene un l&iacute;mite de 1024 caracteres. La funci&oacute;n trunca cualquier valor superior a 1024. + </para> </note> </para> <para> - See also <function>error_reporting</function>, - <function>set_error_handler</function>, - <function>restore_error_handler</function>, - <function>user_error</function> + Puede consultar tambi&eacute;n las funciones <function>error_reporting</function>, <function>set_error_handler</function>, <function>restore_error_handler</function> y las <link linkend="errorfunc.constants"> constantes de nivel de error</link>. </para> </refsect1> </refentry>

« previous php.doc.es (#739) next »