aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-11-12 09:09:57 +0100
committerGitHub <noreply@github.com>2018-11-12 09:09:57 +0100
commitcf27b3f8d20403f454bc3f0762bee137770d44fb (patch)
tree0ad454cec91141af256dbe50fab7c956fefa9fb8
parentf3205f6602f4a47096576208d90f3f11dabb2d60 (diff)
parente1a8136a92c1ac23dcdfdaab455eeda318e81f96 (diff)
downloadnextpnr-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
-rw-r--r--json/jsonparse.cc4
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);