Added exception handling to database creation and deletion. Fixes #8075.

Issue #8075 reports that a traceback occurs when supplying an invalid encoding for database creation. In addition, a traceback occurs if any exception is thrown during database creation or deletion. This update adds exception handling to these calls and reports the final error, if any, back to the user, without the traceback.