I think you mean the error report you get if you use mysql_query($sql) or die(mysql_error()). You should use that on your development server, but never in the production server. mysql_error is just a notification to show what is wrong and used for development, when it is finished and ready for production you should not use those errors anymore.
For your real question there is not only one answer. One way, and the best way if you ask me, is is to check if the username exist when you try to add another, and if it does then tell so. Program to cover every possible way the users can do something wrong or get information from your system.
Another way is to have a standard message if something is wrong. This can (and should) be used along the first solution since you may get into troubles you can't control, for example the database may shut down. You can of course also develop your own way of knowing what the problem is using this way, but I don't recommend it.
function database_error()
{
echo "There currently are problems with the database. Please try again in a few seconds."
return FALSE;
}
// normal code here, whatever you want
// below code to do a database query
$sql = "SELECT column FROM table";
$result = mysql_query($sql) or die(database_error());