-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw exception if a file cannot be opened, fix travis-ci builds (#117)
* throw exception if a file cannot be opened * Add a new function in utils.hpp: open_file_or_throw: This function returns an opened std::ifstream or throws by calling `inja_throw`. * Use this function in Parser::load_file which previously returned an empty string if the file couldn't be opened. * Use this function in Environment::load_json which previously threw a `nlohmann::detail::parse_error` if the file couldn't be opened. * In Parser::parse_statement: When including files through `include`, do not attempt to (re-)parse templates from files that were already included. Additionally, this prevents inja from attempting to load in-memory templates by their name from disk. * Add tests that check if an exception is thrown when attempting to open files that do not exist. * cmake: enable C++11 * cmake: require C++11 when depending on single_inja * code style
- Loading branch information
1 parent
57ac9b9
commit 419c93c
Showing
7 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters