Unfortuntely, it's difficult to avoid all exceptions, because sqlite3_open_v2 does not reliably return SQLITE_NOTADB if the file is not a database. However, this should avoid cases where developers misinterpret the SQLITE_CANTOPEN exception as a crash, which is the common case.
Make sure all the implementations, currently Qt and Default, throw
an exception with error code CANTOPEN when opening a database that
doesn't exist without the CREATE flag.