On Mon, Jul 28, 2025, at 6:48 AM, Rokas Šleinius wrote:

> | real-world example of a use-case you want to enable
>
> 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.
>
> I was always sure that the reason behind all methods of \Exception 
> being final is Larry-Garfield-blogpost length/depth so I never bothered 
> to ask and made workarounds.

Hey, I resemble that remark! :-P

(I actually have no idea what the original reason was for making so much of 
Exceptions final.)

I'm not sure if this would cover what you're talking about, but I did start a 
discussion about lightweight exceptions a few months ago.  I didn't go 
anywhere: 

https://externals.io/message/127188

--Larry Garfield

Reply via email to