From e496296046a5cb4264f8a51982461218bd336ea5 Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Sat, 14 Nov 2020 16:18:27 +0100 Subject: [PATCH] Almost there --- webapp/src/ClimateChart.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/webapp/src/ClimateChart.ts b/webapp/src/ClimateChart.ts index 64a14e3..7e294f4 100644 --- a/webapp/src/ClimateChart.ts +++ b/webapp/src/ClimateChart.ts @@ -45,17 +45,12 @@ class ClimateChart { } private async getInitialDataBlob(): Promise { - try { - const data = await fetch(this.rootUrl + "/data?since=" + new Date((new Date().getTime() - this.minutesDisplayed * 60 * 1000)).toISOString()); - const payload = await data.json(); - if (payload.snapshots.length < 0) { - throw new Error("Bad response - no snapshots found!"); - } - return payload; - } - catch (e) { - throw e; + const data = await fetch(this.rootUrl + "/data?since=" + new Date((new Date().getTime() - this.minutesDisplayed * 60 * 1000)).toISOString()); + const payload = await data.json(); + if (payload.snapshots.length < 0) { + throw new Error("Bad response - no snapshots found!"); } + return payload; } private async initChart() {