Title: Error Handling PHP In WordPress
Last modified: July 19, 2018

---

# Error Handling PHP In WordPress

 *  [Ray Burtoff](https://wordpress.org/support/users/rburtoff/)
 * (@rburtoff)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/error-handling-php-in-wordpress/)
 * I’ve created a series of custom forms that are used to track scheduled officials
   for hockey games. The system works fine, but I want to add error handling into
   the PHP code so that I can easily catch any errors that occur.
 * Unfortunately, the EXIT() and DIE() PHP functions seem to break the page completely,
   as does the WP_DIE() function. I’ve been reduced to putting in a bunch of IF 
   statements to check for previous errors and collecting error information in variables.
   There’s gotta be a better way, and I’m betting the users of these forums know
   all about it.
 * Can someone direct me to some explanations that make actual sense?
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [7 years, 10 months ago](https://wordpress.org/support/topic/error-handling-php-in-wordpress/#post-10510181)
 * [https://codex.wordpress.org/Debugging_in_WordPress](https://codex.wordpress.org/Debugging_in_WordPress)
 *  Thread Starter [Ray Burtoff](https://wordpress.org/support/users/rburtoff/)
 * (@rburtoff)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/error-handling-php-in-wordpress/#post-10510203)
 * Steve,
 * Thanks for the info, and this will probably make my PHP debugging go more quickly,
   but I’m looking for error handling of errors that occur at the user level (database
   timeouts, incorrect information entered, etc.). Something along the lines of 
   a TRY/CATCH block.
 * Appreciate the quick response and the help!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Error Handling PHP In WordPress’ is closed to new replies.

## Tags

 * [error-handling](https://wordpress.org/support/topic-tag/error-handling/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Ray Burtoff](https://wordpress.org/support/users/rburtoff/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/error-handling-php-in-wordpress/#post-10510203)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
