It cannot be caught after php throws an exception. This is an error of WeChat. The third-party class I called, the third-party class throws an exception, but I cannot catch it here.
Call other class methods, this class throws an exception, which cannot be caught in the calling class.
Methods that throw exceptions
Catch exceptions
I feel like I can’t catch it
No matter what is output in my catch, this error always occurs, and my code cannot be executed. I want to throw an exception and then handle my code and then execute it.
Because this is a foreach. When one of them has an error, the following loop will not work. It will be executed
It cannot be caught after php throws an exception. This is an error of WeChat. The third-party class I called, the third-party class throws an exception, but I cannot catch it here.
Call other class methods, this class throws an exception, which cannot be caught in the calling class.
Methods that throw exceptions
Catch exceptions
I feel like I can’t catch it
No matter what is output in my catch, this error always occurs, and my code cannot be executed. I want to throw an exception and then handle my code and then execute it.
Because this is a foreach. When one of them has an error, the following loop will not work. It will be executed
Exception
Add one in front and try
$e->getMessage();
Also, what scholar said
Enter third-party library breakpoints