diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-11-12 09:09:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-12 09:09:57 +0100 |
commit | cf27b3f8d20403f454bc3f0762bee137770d44fb (patch) | |
tree | 0ad454cec91141af256dbe50fab7c956fefa9fb8 /json | |
parent | f3205f6602f4a47096576208d90f3f11dabb2d60 (diff) | |
parent | e1a8136a92c1ac23dcdfdaab455eeda318e81f96 (diff) | |
download | nextpnr-cf27b3f8d20403f454bc3f0762bee137770d44fb.tar.gz nextpnr-cf27b3f8d20403f454bc3f0762bee137770d44fb.tar.bz2 nextpnr-cf27b3f8d20403f454bc3f0762bee137770d44fb.zip |
Merge pull request #108 from dlharmon/master
Improve error reporting of failure to open JSON file
Diffstat (limited to 'json')
-rw-r--r-- | json/jsonparse.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/json/jsonparse.cc b/json/jsonparse.cc index a690bf18..e7f39a19 100644 --- a/json/jsonparse.cc +++ b/json/jsonparse.cc @@ -749,6 +749,10 @@ bool parse_json_file(std::istream &f, std::string &filename, Context *ctx) { try { using namespace JsonParser; + + if (!f) + log_error("failed to open JSON file.\n"); + int lineno = 1; JsonNode root(f, lineno); |