Exception handling for database creation