From 48ad95364898a5d70f6b43108d91c4ea4f5eed34 Mon Sep 17 00:00:00 2001 From: VaclavT Date: Mon, 22 Mar 2021 06:50:46 +0100 Subject: [PATCH] fix for non existing dirs in ls-dir --- ml_io.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ml_io.cpp b/ml_io.cpp index 0fc3e7f..1889b65 100644 --- a/ml_io.cpp +++ b/ml_io.cpp @@ -36,7 +36,7 @@ MlValue list_dir(const std::string &path) { DIR *dirp = opendir(path.c_str()); if (dirp == NULL) { - // handle error - probably not a dir or non existing path + throw std::runtime_error("could not open dir (" + path + ")"); } struct dirent *dp; while ((dp = readdir(dirp)) != NULL) {