use exception to handle databaes error for SQLite test