Behave more nicely when doc creation fails