Additional error conditions. Fixes DOC-1063

@shnayder please review
@catong , @mhoeber , @srpearce , I’d like to publish this as soon as
Victor gives the ok.