Additional error conditions. Fixes DOC-1063

@shnayder please review (you suggested these additions a few weeks back).
@catong , @mhoeber , @srpearce , I’d like to publish this as soon as
Victor gives the ok.