From cdd0f0fea0555129a16ff0a2c337333b3493b173 Mon Sep 17 00:00:00 2001 From: Darrell Harmon Date: Sun, 11 Nov 2018 12:50:14 -0700 Subject: [PATCH] better error message on failure to open JSON file --- json/jsonparse.cc | 4 ++++ 1 file changed, 4 insertions(+) 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);