Re: [RFC] Throwable Hierarchy Policy for Extensions

From: Date: Sun, 27 Apr 2025 20:57:28 +0000
Subject: Re: [RFC] Throwable Hierarchy Policy for Extensions
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message


On Sun, Apr 27, 2025, at 22:40, Kamil Tekiela wrote:
> >The exception message MUST NOT be the only property that allows to
> differentiate different types of error that the user may be interested in.
> 
> What does this mean exactly? Can you give an example?
> 

Many people don’t know about the $previous property, which allows you to chain exceptions, for
example. I’ve worked in more than one codebase with custom exceptions that are missing that. It
makes for throwing from a catch more nebulous as you lose how you got there in the first place. 

— Rob


Thread (6 messages)

« previous php.internals (#127212) next »