Skip to content
Snippets Groups Projects
Commit 67354173 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add better error reporting when listfile can't be found on disk

For Dumas Walker (CAPCITY2)
parent a987cf4b
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
Pipeline #6251 passed
......@@ -180,20 +180,23 @@ for(var d = 0; d < dir_list.length; d++) {
var listpath;
if(listfile) {
listpath = file_getcase(dir.path + listfile) || file_getcase(listfile);
var f = new File(listpath);
if(f.exists) {
writeln("Opening " + f.name);
if(!f.open('r')) {
alert("Error " + f.error + " (" + strerror(f.error) + ") opening " + f.name);
exit(1);
}
file_list = parse_file_list(f.readAll());
f.close();
} else {
alert(dir.path + file_getname(listfile) + " does not exist");
if(file_getname(listfile) == listfile)
listpath = dir.path + listfile;
else
listpath = listfile;
var realpath = file_getcase(listpath);
if(!realpath) {
alert(listpath + " does not exist");
continue;
}
var f = new File(realpath);
writeln("Opening " + f.name);
if(!f.open('r')) {
alert("Error " + f.error + " (" + strerror(f.error) + ") opening " + f.name);
exit(1);
}
file_list = parse_file_list(f.readAll());
f.close();
}
else {
var list = directory(dir.path + '*');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment