WordPress.org

Ready to get started?Download WordPress

Forums

Graceful error-handling required for production si (7 posts)

  1. ScottAllen
    Member
    Posted 10 years ago #

    WordPress needs graceful error-handling if it's going to be implemented on production sites. As it stands, if I use WP code just to display headlines on my front page, and the database is unavailable for any reason, or there's any kind of PHP problem, I get a page full of PHP errors, rather than the main content of my page, simply sans the headlines.
    Simply put, if WordPress display code fails for ANY reason, I want to have it return a null string, or better yet, the string of my choosing.
    This is a requirement to use it on any kind of mission-critical site.

  2. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    I assume you're using the $wpdb class and you're referring to how it dies with an error message if it can't connect to the database. What would you suggest the best behaviour would be for a database class that can't connect to the database?

  3. carthik
    Member
    Posted 10 years ago #

    I guess the point allusion is trying to make is that without proper error reporting, debugging, or even knowing about an existing problem will be a huge problem.
    In any case, the file wp-db.php in wp-includes has the following line :
    17 var $show_errors = true;
    you can change that to
    var $show_errors = false; to supress error messages thrown by the database class wpdb.

  4. ericr23
    Member
    Posted 7 years ago #

    I have the same problem on my home page. The WordPress error page also ends the host page, which makes a mess of the layout. Is there a way to enclose the included WordPress functions in an "onerror" type of control structure?

  5. vkaryl
    Member
    Posted 7 years ago #

    Actually, that's probably a really good question.... but I have the feeling you should perhaps start a new thread, this one being so old.

    And you might want to post to an appropriate list: http://lists.automattic.com/ - probably hackers....

  6. ericr23
    Member
    Posted 7 years ago #

    In fact I asked this question on a new thread just before finding the issue raised here. I was not aware of those lists -- many thanks.

  7. Michael Bishop

    Posted 7 years ago #

    I've tagged your original post, so perhaps someone will chime in there before you post to wp-hackers.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.