Skip to content

Commit

Permalink
Give better error message if a helpfile is missing
Browse files Browse the repository at this point in the history
... or if it inaccessible (e.g. due to missing read access)
  • Loading branch information
fingolfin authored and alex-konovalov committed Nov 9, 2016
1 parent 3f7ca3d commit a624385
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/helpdef.gi
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,14 @@ InstallGlobalFunction(HELP_CHAPTER_INFO, function( book, chapter )

filename := Filename( info.directories, info.filenames[chapter] );
if filename = fail then
Error("help file ", info.filenames[chapter], " for help book '", book.bookname, "' not found");
return fail;
fi;
stream := StringStreamInputTextFile(filename);
if stream = fail then
Error("help file ", filename, " does not exist or is not readable");
return fail;
fi;
poss := [];
secnum := 0;
repeat
Expand Down
2 changes: 1 addition & 1 deletion lib/helpt2t.gi
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ local book, chapter, section, key, subkey, MatchKey, ssectypes,
info := HELP_BOOK_INFO(book);
chap := HELP_CHAPTER_INFO( book, chapter );
if chap = fail then
return;
return fail;
fi;

# store lines
Expand Down

0 comments on commit a624385

Please sign in to comment.