Write error on failure in directory_server

[#80319590]