logentries.LogEntryFactory creates invalid LogEntry type instead of raising an error:
>>> import pwb, pywikibot as py
>>> from pywikibot.logentries import LogEntry
>>> site = py.Site()
>>> lef = LogEntryFactory(site)
>>> data = {'type': 'foo'}
>>> x = lef._createFromData(data)
>>> type(x)
<class 'pywikibot.logentries.LogEntry'>
>>> x.type()
'foo'
>>> x._expectedType is None
True
>>>There is an exception handling inside _createFromData() method but the KeyError will never raised because _getEntryClass takes it and always returns a generic LogEntry object.