issue error directly when doc is malformated

This should popup a message saying "No reader engine for this file"
instead of a crash when document file is malformated.

This should fix #868.