Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128254 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id C08911A00BC for ; Mon, 28 Jul 2025 12:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1753704789; bh=GCENcXDiDVmBlXnxiS8rxf33CVhOunhJxGkSEYUqMDU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dnadqbbsst7ke7pQx5ZESNg/YxXqER3H9nsgMQ31r0UxWgdgerZTDTnW8tItp/AHI NCTqKL+b7GeNnu1muiHLHKCA3pD4sWLR2unx79iv1T+03rN/lPXO797C1i1w4Qq0At 267IFh1/QRPZlzCKY9P8KLatCAh7jGhCsksQLAa8uBSmw1Dg9daLiMSaPQBDgswwIc 4xMA/hvjU8iu9W8XKFRgUP8OaH2q2thHdIFqz/WOAzUYBP1V1iRW/0gO7Pi1OKQpV7 zXa4o0C/e3CQRWx9QMo4yXctB+9QIij+NF4WjjebHTCGK+Y37Kw8t/UdxN21GUkqGx Cwxba2+f72bOg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6105A180212 for ; Mon, 28 Jul 2025 12:13:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 28 Jul 2025 12:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1753704889; bh=BaNgY0cNj7AVEpQfUD4zFH+KGbSng98XdH6hXO/Exko=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=CfVZX1vqEXSVqC4wiv+IZR7VvrJot+uvdpQQ0NDbTBAqRbgqEBrbd6cMt/pX6mFY9 dyMficWr3CTSWVYhbho5gwuxh/mr4Zb1LwQMW1aBUrh1r/wFu+ATsqhJucT3rS/UbH aMfMof2gbxF6GHjRIx3hrpLYCEU0aKeX0KhaHlZ0Nq6G4hYdM6qJQwo4sgFMTzdul1 MPB5lD76RPcTztul3hl/mGeq+xAWYsLJHIJF4R6BYM8An527rieDXtcC8Fcq2Jywu0 XQMoOs7l/qgXbpDqatlHaEtSua/Q9wl/MY3SYVEy/+eyJl5b2Bpoh58BN29dx92b/5 K7FAbm/TJ9jWw== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Mon, 28 Jul 2025 14:14:49 +0200 To: =?UTF-8?Q?Rokas_=C5=A0leinius?= Cc: PHP internals Subject: Re: [PHP-DEV] [DISCUSSION] User-land Throwable In-Reply-To: References: <73a35675dff31a1eaf76b67af567194e@bastelstu.be> Message-ID: <8213ec624731316fd6ca56f5f5c6ad47@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2025-07-28 13:48, schrieb Rokas Šleinius: > Say I am implementing a job runner, I do its error handling, and I want > to > enrich the caught exception with additional helpful data for debugging. > In > this process I create a custom exception MyJobHandlerException, but the > trace of the new exception includes my handler code, which the end user > does not care about. I wish to overwrite the trace of the new > MyJobHandlerException instance with the trace from the originally > caught > exception, but I cannot. In this case the original exception should be set as the `$previous` exception for the `MyJobHandlerException` and then the resulting exception includes both the original's and the new exception's stack trace. Every exception handler worth its salt (including PHP's handler for uncaught exceptions) will print the entire exception stack: https://3v4l.org/2pc2Z