• 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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • 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?

    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.

    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?

    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….

    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.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Graceful error-handling required for production si’ is closed to new replies.