From c110a56ea9ee296074b692222c3d425bde35b564 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 14 Jan 2016 16:21:25 +1100 Subject: [PATCH] Print unparsable file in pkg-map As you can see in the CI failures for Ib11b9df84b593ab25232729a570c812f1b4b8774, you can not see what file is causing the problems when the parser fails. Add a print, but raise the error as it contains the cause. Change-Id: I127ff7d57d2d898969195464c6e774d496e872e6 --- elements/pkg-map/bin/pkg-map | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/elements/pkg-map/bin/pkg-map b/elements/pkg-map/bin/pkg-map index 85d03d67..9ece74d1 100755 --- a/elements/pkg-map/bin/pkg-map +++ b/elements/pkg-map/bin/pkg-map @@ -74,7 +74,11 @@ def main(): sys.exit(2) with open(map_file) as fd: - package_names = json.loads(fd.read()) + try: + package_names = json.loads(fd.read()) + except ValueError: + eprint('Unable to parse %s' % map_file) + raise # Parse mapping data in this form using distro/family/default # Most specific takes priority (distro is most specific).