Catch exception when querying the database
Create custom error handling for debugging.
Merge pull request #3 from BeiYang123/master

Create custom error handling for debugging.