Need 404 behaviour for blank parent page

In functions.php

function productsPageRedirect_404() {
    global $post;
    if( is_page('products') ) {
       global $wp_query;
       $wp_query->set_404();
       status_header(404);
    }
}

add_action( 'wp', 'productsPageRedirect_404' );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)