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

javascript - Unable to catch exception after php throws it

WBOY
Release: 2023-03-01 16:24:01
Original
1331 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template