try {
// code
} catch (\Exception $e) {
wp_die('<h1 style="color:red;">Exception:</h1> ' . $e->getMessage());
} catch (\Error $e) {
wp_die('<h1 style="color:red;">PHP Fatal Error:</h1> ' . $e->getMessage() . ' file ' . $e->getFile() . ' line ' . $e->getLine());
}
How to catch PHP errors o WordPress
0 0 votes Article Rating
Subscribe
Login
0 Comments
Oldest

