Skip to content

Commit

Permalink
add drupal exception handler
Browse files Browse the repository at this point in the history
  • Loading branch information
bduranleau-nr committed Nov 22, 2024
1 parent 2d73c33 commit fd5d581
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions agent/fw_drupal8.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@

#define PHP_PACKAGE_NAME "drupal/core"

NR_PHP_WRAPPER(nr_symfony4_exception) {
NR_PHP_WRAPPER(nr_drupal_exception) {
int priority = nr_php_error_get_priority(E_ERROR);
zval* event = NULL;
zval* exception = NULL;

/* Warning avoidance */
(void)wraprec;

NR_PHP_WRAPPER_REQUIRE_FRAMEWORK(NR_FW_DRUPAL8);

if (NR_SUCCESS != nr_txn_record_error_worthy(NRPRG(txn), priority)) {
NR_PHP_WRAPPER_CALL;
goto end;
Expand Down Expand Up @@ -785,10 +787,9 @@ void nr_drupal8_enable(TSRMLS_D) {

nr_php_error_install_exception_handler();

nr_php_wrap_user_function(
NR_PSTR("Symfony\\Component\\HttpKernel\\"
"EventListener\\ErrorListener::onKernelException"),
nr_symfony4_exception TSRMLS_CC);
nr_php_wrap_user_function(NR_PSTR("Drupal\\Core\\EventSubscriber\\HttpExcepti"
"onSubscriberBase::onException"),
nr_drupal_exception TSRMLS_CC);
/*
* The drupal_modules config setting controls instrumentation of modules,
* hooks, and views.
Expand Down

0 comments on commit fd5d581

Please sign in to comment.