From 5b042f76a13ded7dd527386e46d49d3f4523aaef Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 13 Nov 2019 07:14:11 +1100 Subject: [PATCH] Add debugging --- .../org/hl7/fhir/utilities/cache/NpmPackage.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java index bf4a2d66b..c0ae6c885 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java @@ -184,8 +184,16 @@ public class NpmPackage { } res.content.put("package/.index.json", indexer.build().getBytes(Charsets.UTF_8)); } - res.npm = JsonTrackingParser.parseJson(res.content.get("package/package.json")); - res.readIndexFile((JsonObject) new com.google.gson.JsonParser().parse(new String(res.content.get("package/.index.json")))); + try { + res.npm = JsonTrackingParser.parseJson(res.content.get("package/package.json")); + } catch (Exception e) { + throw new IOException("Error parsing package/package.json: "+e.getMessage(), e); + } + try { + res.readIndexFile((JsonObject) JsonTrackingParser.parseJson(new String(res.content.get("package/.index.json")))); + } catch (Exception e) { + throw new IOException("Error parsing package/.index.json: "+e.getMessage(), e); + } return res; }