emit error on doc save