Skip to content

Commit

Permalink
log/trap do_action errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveorevo committed Jul 20, 2023
1 parent 179e1ee commit 9f37738
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion hooks/pluginable.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,15 @@ public function do_action( $tag, $arg = '' ) {
$args[] = func_get_arg($a);

foreach ( $this->hcpp_filters[$tag] as $func ) {
$arg = call_user_func_array( $func, $args );
try {
$arg = call_user_func_array( $func, $args );
} catch (Exception $e) {

// Echo out the error message if an exception occurs
echo 'Error: do_action failed ' . $e->getMessage();
$this->log( 'Error: do_action failed ' . $e->getMessage() );
}

if ($arg != null) {
$args = array();
if ( is_array($arg) && 1 == count($arg) && isset($arg[0]) && is_object($arg[0]) ) // array(&$this)
Expand Down

0 comments on commit 9f37738

Please sign in to comment.