Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73674 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58097 invoked from network); 12 Apr 2014 01:05:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Apr 2014 01:05:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=marco@m-s-d.eu; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=marco@m-s-d.eu; sender-id=unknown Received-SPF: error (pb1.pair.com: domain m-s-d.eu from 209.85.223.181 cause and error) X-PHP-List-Original-Sender: marco@m-s-d.eu X-Host-Fingerprint: 209.85.223.181 mail-ie0-f181.google.com Received: from [209.85.223.181] ([209.85.223.181:48630] helo=mail-ie0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/10-55158-E4198435 for ; Fri, 11 Apr 2014 21:05:20 -0400 Received: by mail-ie0-f181.google.com with SMTP id tp5so6109130ieb.40 for ; Fri, 11 Apr 2014 18:05:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=7ZiAORx+8IwYGJH4AMpUmpSKopvP6FVzp7d6BNgxqxg=; b=EFotPR8bA0TVNaXemY8Q4jk7RPYdDGNsuYEDgN1KQ495Zgr7lVnWC/tzGaljFCqnme JhKvHakpB3V8DXjCaUqe4tj1XyDCpS2lvMAwJPsad7trdfUpcYAPTBWXvK+vLdJjGo7X ohd35lY4Cj33eAsKpiKj4whCN+iYHE0SsaZZInTW+ZpyZV4Hl0ZiOjqUy5aqN/V/Indv LkTj/1CENiseij11Hj1B9bCjqiuUunHF6v0Y7vECTVsh/G9OgnlxedapkcRHJyveoma6 E9Bu5QKvuQtnWnUWvixiO6UUH3Q/3l0cku76oB2HfuA9sQSgNqHyrX0Tu7LTRvcheOpi 3k2Q== X-Gm-Message-State: ALoCoQl0kvhBk3QZFBuawfaBMHxqNRJ6++Rfg3BYUm5bFgkb4GgT+sVlODYAg0SeV+M4GDHvSHWj MIME-Version: 1.0 X-Received: by 10.50.12.100 with SMTP id x4mr705563igb.15.1397264716227; Fri, 11 Apr 2014 18:05:16 -0700 (PDT) Sender: marco@m-s-d.eu Received: by 10.64.225.169 with HTTP; Fri, 11 Apr 2014 18:05:16 -0700 (PDT) X-Originating-IP: [84.153.72.13] In-Reply-To: <53482BE0.4060005@sugarcrm.com> References: <53446FC5.7000001@gmail.com> <53459231.2080402@gmail.com> <5345AE83.1070506@sugarcrm.com> <53482BE0.4060005@sugarcrm.com> Date: Sat, 12 Apr 2014 03:05:16 +0200 X-Google-Sender-Auth: YhnKJSX7QDAj7SLxUsCl9MFuh4k Message-ID: To: Stas Malyshev Cc: Kris Craig , Julien Pauli , Rowan Collins , PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [PHP.next] Error-handling using "Error Events" From: marco+php@m-s-d.eu (Marco Schuster) On Fri, Apr 11, 2014 at 7:52 PM, Stas Malyshev wrote: > Hi! > >> behavior using try/catch blocks as Stas mentioned. However, people who >> actually want this sort of behavior so they can route everything through >> their own custom handlers (might be particularly useful for framework >> developers) could switch it on. Something like ini_set( > > Why just not set error handler which would throw an exception? You manually have to reconstruct the stack trace from the exception handler; also, with this approach you lose the ability to fine-control where you want to react on which exceptions in which way - unless you do a save/restore every time... Also, you need to parse the error string by PHP (e.g. in one code block you do a fopen followed by a mysqli_connect, both might throw you a E_WARNING) in order to find out what's going on. Marco