Catching std::exception doesn't catch exceptions thrown by wxDatabase. Derive wxDatabaseException from std::exception to resolve.