throw exception if cache dir cannot be created