Home  >  Article  >  Backend Development  >  javascript - Unable to catch exception after php throws it

javascript - Unable to catch exception after php throws it

WBOY
WBOYOriginal
2016-12-01 00:25:311213browse

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
javascript - Unable to catch exception after php throws it

Catch exceptions
javascript - Unable to catch exception after php throws it

I feel like I can’t catch it

javascript - Unable to catch exception after php throws 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

Reply content:

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
javascript - Unable to catch exception after php throws it

Catch exceptions
javascript - Unable to catch exception after php throws it

I feel like I can’t catch it

javascript - Unable to catch exception after php throws 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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn