changeset 8:f37b4c00a863

Add better error message for missing .subpaths
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 10 Sep 2018 17:29:26 +0200
parents 309cc6c0cd75
children 57304525dffe
files +mpm/subpaths.m
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/+mpm/subpaths.m	Mon Sep 10 17:05:03 2018 +0200
+++ b/+mpm/subpaths.m	Mon Sep 10 17:29:26 2018 +0200
@@ -3,7 +3,10 @@
         d = '';
     end
 
-    % TODO: Nice error message if file doesn't exist
-    fstr = fileread(fullfile(d, '.subpaths'));
+    try
+        fstr = fileread(fullfile(d, '.subpaths'));
+    catch
+        error('Subpath definition file ''.subpaths'' not found.')
+    end
     sp = splitlines(strtrim(fstr));
 end