Added basic exception handling to enable running the program without a database to connect to