CSPACE-6273: Identified that directory_exists function returns a value; added documentation and error checking to function.