@@ -250,19 +250,21 @@ void nr_symfony4_enable(TSRMLS_D) {
250250 * nr_txn_record_error and pass the exception message. Now we get errors in
251251 * the error analytics page.
252252 */
253- nr_php_wrap_user_function (
254- NR_PSTR ("Symfony\\Component\\HttpKernel\\"
255- "EventListener\\ExceptionListener::onKernelException" ),
256- nr_symfony4_exception TSRMLS_CC );
253+ if (!NRINI (ignore_framework_error_exception_handler )) {
254+ nr_php_wrap_user_function (
255+ NR_PSTR ("Symfony\\Component\\HttpKernel\\"
256+ "EventListener\\ExceptionListener::onKernelException" ),
257+ nr_symfony4_exception TSRMLS_CC );
257258
258- /*
259- * In Symfony 5 listener that catch errors was changed to ErrorListener,
260- * we try to hook into it
261- */
262- nr_php_wrap_user_function (
263- NR_PSTR ("Symfony\\Component\\HttpKernel\\"
264- "EventListener\\ErrorListener::onKernelException" ),
265- nr_symfony4_exception TSRMLS_CC );
259+ /*
260+ * In Symfony 5 listener that catch errors was changed to ErrorListener,
261+ * we try to hook into it
262+ */
263+ nr_php_wrap_user_function (
264+ NR_PSTR ("Symfony\\Component\\HttpKernel\\"
265+ "EventListener\\ErrorListener::onKernelException" ),
266+ nr_symfony4_exception TSRMLS_CC );
267+ }
266268
267269 /*
268270 * Listen for Symfony commands so we can name those appropriately.
0 commit comments