output error message when failed to connect database