aboutsummaryrefslogtreecommitdiffstats
path: root/json
diff options
context:
space:
mode:
authorDarrell Harmon <darrell@harmoninstruments.com>2018-11-11 12:50:14 -0700
committerDarrell Harmon <darrell@harmoninstruments.com>2018-11-11 12:50:14 -0700
commitcdd0f0fea0555129a16ff0a2c337333b3493b173 (patch)
tree699980339c8874b53119e0519527dbdc7d24b915 /json
parent15d9b3d3cc05656e58d01ba2f97ec92b6daaee1c (diff)
downloadnextpnr-cdd0f0fea0555129a16ff0a2c337333b3493b173.tar.gz
nextpnr-cdd0f0fea0555129a16ff0a2c337333b3493b173.tar.bz2
nextpnr-cdd0f0fea0555129a16ff0a2c337333b3493b173.zip
better error message on failure to open JSON file
Diffstat (limited to 'json')
-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);