Add backtrace to all errors

Created on 15 May 2011, over 13 years ago
Updated 19 June 2024, 5 months ago

Starting with Drupal 7, the system has become extremely modular. Generic functions are re-used in many places, so it's a horrible job to figure out where exactly an error originates from.

Issues like #1067750: Let Field API fail in a tale-telling way on invalid $entity only underline the problem space.

There are several problems with introducing a backtrace and the current patch attempts to address them. Some issues are:

We need better reporting for developers

A clear formatting has been setup and can easily be customized with a little CSS.

There is no one reporting format that will be universally useful

Various options to set the level of detail returned are available.

We don't want to make things complicated for the average user

These extra options are hidden in a collapsed fieldset and described as "being for developers."

We need to avoid possibly crashing from processing large variables that may even have recursion

Defaults to limit the length of variables that can be returned yet is adjustable if a developer needs more information.

Keeping it simple

The added options are added to the familiar: admin/config/development/logging configuration page.

Note: This patch may look large at first glance but once you mitigate the constant definitions at the top, the functions added to the bottom of errors.inc which only provide some nice formatting and the additions to the UI at admin/config/development/logging, it's quite modest.

📌 Task
Status

Needs review

Version

7.0 ⚰️

Component
Base 

Last updated about 17 hours ago

Created by

🇩🇪Germany sun Karlsruhe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024