with con:
    for a, b, c, d in inputs:
        if any(elem is None for elem in (a, b, c, d)):
            raise ValueError('Fields must not be empty.')
con.execute('INSERT OR IGNORE INTO ABCD VALUES (?, ?, ?, ?)', (a, b, c, d))
con.close()
pysqlite's IntegrityError: distinguish 'NOT NULL' from 'UNIQUE' violation