P粉6114563092023-08-23 14:46:31
I just ran into this exact problem, it feels like I've even copied the name of the exception and it's not catching it. Turns out to be a stupid mistake on my part, but I thought I'd post my situation here in case anyone else is in the same situation.
My exception is called A in my namespace and the script is called B in one namespace. The problem is that I have a A\MyException which is equal (in PHP) to \B\A\MyException (because my script is called B# in the namespace ##!). All I had to do was add a backslash (or whatever it was called) before the exception name to fix it so it looked like this: \A\MyException