Skip to content
Snippets Groups Projects
Commit 7b7cc8d7 authored by Angelos Evripiotis's avatar Angelos Evripiotis
Browse files

_includes: better error on including directory

Previously, a missing include would result in an error like this:

    mydir is a directory. bst command expects a .bst file.

Note that the file containing the include was not mentioned.

Now we get an error like this instead:

    element.bst [line 12 column 0]: Include block references a
    directory instead of a file: 'mydir'.
parent 9746e19a
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,10 @@ class Includes:
message = "{}: Include block references a file that could not be found: '{}'.".format(
include_provenance, include)
raise LoadError(LoadErrorReason.MISSING_FILE, message) from e
elif e.reason == LoadErrorReason.LOADING_DIRECTORY:
message = "{}: Include block references a directory instead of a file: '{}'.".format(
include_provenance, include)
raise LoadError(LoadErrorReason.LOADING_DIRECTORY, message) from e
else:
raise
......
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