added extra error handling for invalid query and invalid database name
added extra error handling for invalid query and invalid database name

hudl/redash,chriszs/redash,easytaxibr/redash,getredash/redash,alexanderlz/redash,ninneko/redash,imsally/redash,useabode/redash,ninneko/redash,vishesh92/redash,crowdworks/redash,stefanseifert/redash,EverlyWell/redash,44px/redash,EverlyWell/redash,useabode/redash,rockwotj/redash,guaguadev/redash,getredash/redash,jmvasquez/redashtest,guaguadev/redash,moritz9/redash,jmvasquez/redashtest,rockwotj/redash,crowdworks/redash,crowdworks/redash,vishesh92/redash,EverlyWell/redash,amino-data/redash,denisov-vlad/redash,EverlyWell/redash,alexanderlz/redash,M32Media/redash,ninneko/redash,easytaxibr/redash,useabode/redash,alexanderlz/redash,getredash/redash,denisov-vlad/redash,useabode/redash,44px/redash,vishesh92/redash,chriszs/redash,amino-data/redash,crowdworks/redash,ninneko/redash,guaguadev/redash,amino-data/redash,akariv/redash,stefanseifert/redash,moritz9/redash,moritz9/redash,getredash/redash,rockwotj/redash,hudl/redash,alexanderlz/redash,stefanseifert/redash,imsally/redash,hudl/redash,M32Media/redash,pubnative/redash,imsally/redash,guaguadev/redash,easytaxibr/redash,denisov-vlad/redash,44px/redash,amino-data/redash,chriszs/redash,akariv/redash,44px/redash,getredash/redash,M32Media/redash,denisov-vlad/redash,ninneko/redash,easytaxibr/redash,guaguadev/redash,M32Media/redash,jmvasquez/redashtest,denisov-vlad/redash,chriszs/redash,pubnative/redash,hudl/redash,rockwotj/redash,akariv/redash,pubnative/redash,imsally/redash,vishesh92/redash,easytaxibr/redash,pubnative/redash,stefanseifert/redash,jmvasquez/redashtest,moritz9/redash,stefanseifert/redash,pubnative/redash,akariv/redash,jmvasquez/redashtest,akariv/redash