1
0
mirror of https://github.com/php/doc-tr.git synced 2026-03-24 07:12:18 +01:00
Files
archived-doc-tr/reference/errorfunc/functions/set-exception-handler.xml
2023-03-24 16:11:16 +03:00

147 lines
4.2 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 686b6869e2695d96d0f3a2055cfa629a8b3b1ac7 Maintainer: nilgun Status: ready -->
<refentry xml:id="function.set-exception-handler" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>set_exception_handler</refname>
<refpurpose>Kullanıcı tanımlı bir istisna işleyici bildirir
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>callable</type><type>null</type></type>
<methodname>set_exception_handler</methodname>
<methodparam><type class="union"><type>callable</type><type>null</type></type><parameter>istisna_işleyici</parameter></methodparam>
</methodsynopsis>
<para>
İstisna bir <link linkend="language.exceptions">
<literal>try/catch</literal> bloğu</link> içinde yakalanamadığı durumlarda
kullanılmak üzere bir istisna işleyici bildirir.
<parameter>istisna_işleyici</parameter> işlevinin çağrılmasıyla
istisna durdurulmuş olur.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>istisna_işleyici</parameter></term>
<listitem>
<para>
Yakalanmamış bir istisna olduğunda çağrılacak işlev. Yavrulanacak
<classname>Throwable</classname> nesnesi için bir bağımsız değişken kabul
etmesi gerekir. <classname>Error</classname> ve
<classname>Exception</classname> sınıflarının ikisi de
<classname>Throwable</classname> arayüzünü gerçekler.
Kullanılacak işleyicinin tanımı:
</para>
<para>
<methodsynopsis>
<type>void</type><methodname><replaceable>işleyici</replaceable></methodname>
<methodparam><type>Throwable</type><parameter>istisna</parameter></methodparam>
</methodsynopsis>
</para>
<para>
Bu işleyiciyi öntanımlı duruma sıfırlamak yerine &null; aktarılabilir.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Hata durumunda &null; aksi takdirde evvelce tanımlanmış istisna
işleyicinin ismini döndürür. Evvelce tanımlanmış bir işleyici olmaması
durumunda da &null; döner.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>7.0.0</entry>
<entry>
<parameter>istisna_işleyici</parameter>'ne aktarılan bağımsız değişkenin türü artık <classname>Exception</classname> değil,
<classname>Throwable</classname>.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>- <function>set_exception_handler</function> örneği</title>
<programlisting role="php">
<![CDATA[
<?php
function istisna_işleyici(Throwable $istisna) {
echo "Yakalanmamış istisna: " , $istisna->getMessage(), "\n";
}
set_exception_handler('istisna_işleyici');
throw new Exception('Yakalanmamış İstisna');
echo "Çalışmadı\n";
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso"><!-- {{{ -->
&reftitle.seealso;
<para>
<simplelist>
<member><function>restore_exception_handler</function></member>
<member><function>restore_error_handler</function></member>
<member><function>error_reporting</function></member>
<member><link linkend="language.exceptions">İstisnalar</link></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
-->