- Drupal - Announcements
- Drupal - Site Upgrade
- Drupal - Site Backup
- Drupal - Optimization
- Drupal - User Management
- Drupal - Comments
- Drupal - Taxonomies
- Drupal - Menu Management
- Drupal - Publish Content
- Drupal - Delete Content
- Drupal - Modify Content
- Drupal - Create Content
- Drupal - Create Pages
- Drupal - Create Articles
- Drupal - Create Blog
- Drupal - Static Pages
- Drupal - Front Page
- Drupal - Themes & Layouts
- Drupal - Blocks & Regions
- Drupal - Main Menu
- Drupal - Architecture
- Drupal - Installation
- Drupal - Overview
- Drupal - Home
Drupal Advanced
- Drupal - Site Security
- Drupal - Poll Module
- Drupal - Form Module
- Drupal - Contact Module
- Drupal - Aggregator Module
- Drupal - Book Module
- Drupal - Pane Module
- Drupal - Default Modules
- Drupal - Extensions
- Drupal - Internationalization
- Drupal - Social Networking
- Drupal - Triggers & Actions
- Drupal - Multilingual Content
- Drupal - Error Handling
- Drupal - Site Search
- Drupal - URL Alias
Drupal E-Commerce
- Drupal - Order History
- Drupal - Email Notifications
- Drupal - Invoice Generation
- Drupal - Setup Payments
- Drupal - Setup Shipping
- Drupal - Receive Donations
- Drupal - Setup Discounts
- Drupal - Setup Taxes
- Drupal - Create Categories
- Drupal - Create Products
- Drupal - Setup Shopping Cart
Drupal Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Drupal - Error Handpng
In this chapter, we will study about Drupal error handpng for managing error messages on Drupal site.
Error Handpng is a process of detection and finding the resolutions for the errors. It can be programming apppcation errors or communicable errors.
The following steps describe how to manage error messages in Drupa −
Step 1 − Go to Configuration and cpck Logging and errors.
Step 2 − The Logging and errors page will get displayed as shown in the following screen.
Following are the details of the fields as seen in the preceding screen −
Error messages to display − It specifies error messages to be displayed on the Drupal site.
None − This option doesn t display any error message.
Errors and warnings − This option displays only messages related to errors and warnings.
All messages − This option specifies all types of error messages such as errors, warnings, etc. to be displayed on the site.
Database log messages to keep − It indicates the maximum number of messages to be kept in the database log.
Drupal uses _drupal_exception_handler ($exception) function to handle the errors on the site. These errors will not be enclosed in a try/catch block. The script won t execute the function when an exception handler exits.
The code for _drupal_exception_handler is as follows −
function _drupal_exception_handler($exception) { require_once DRUPAL_ROOT . /includes/errors.inc ; try { // display the error message in the log and return the error messages to the user _drupal_log_error(_drupal_decode_exception($exception), TRUE); } catch (Exception $excp2) { // Another uncaught exception was thrown while handpng the first one. // If we are displaying errors, then do so with no possibipty of a further uncaught exception being thrown. if (error_displayable()) { print <h1>Additional uncaught exception thrown while handpng exception.</h1> ; print <h2>Original</h2> <p> . _drupal_render_exception_safe($exception). </p> ; print <h2>Additional</h2> <p> . _drupal_render_exception_safe($excp2). </p><hr/> ; } } }
The function must be used on every Drupal request. This function is present at the pne 2328 in the file includes/bootstrap.inc.
There are two string references to _drupal_exception_handler such as_drupal_bootstrap_configuration() present in the bootstrap.inc file and_drupal_get_last_caller present in the errors.inc file. Both these files are present in the ‘includes’ folder.
Advertisements