A red error message displaying on your webpage, visible to every visitor is the worst thing you can do to your site. Unfortunately, drupal displays error messages on the screen by default. There are several solutions to this problem.
1. Install disable_messages plugin
The disable messages plugin is only available for drupal 6 and drupal 7.
2. Edit page.tpl file
Remove the following piece of code from your page.tpl file
if ($show_messages && $messages): print $messages; endif;
3. Edit style.css file
Go into your style.css file and find the block for error messages. Then add the following line to it.
display: none
4. Edit error reporting preferences
Go to Administer > Site Configuration > Error Reporting Set Write error messages to the log and to the screen to Write error messages to the log