From 053a2e9ec90375cc1e8b3b362c5e4161af19615b Mon Sep 17 00:00:00 2001 From: KungKurt Date: Sun, 23 Feb 2025 22:41:02 +0100 Subject: [PATCH] updated to version 0.1.26 --- module.json | 2 +- scripts/puckoapi/puckoapi.js | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/module.json b/module.json index 4377ebe..344cd9d 100644 --- a/module.json +++ b/module.json @@ -6,7 +6,7 @@ "authors": [ { "name": "Robin Riis" } ], - "version": "0.1.25", + "version": "0.1.26", "socket": true, "minimumCoreVersion": 10, "compatibility": { diff --git a/scripts/puckoapi/puckoapi.js b/scripts/puckoapi/puckoapi.js index 3c5c2d7..f7e1441 100644 --- a/scripts/puckoapi/puckoapi.js +++ b/scripts/puckoapi/puckoapi.js @@ -7,12 +7,13 @@ export class PuckoPruttApi { } async _fetch_json(url) { - const response = await fetch(this.apiUrl + url); - if (!response.ok) { - return -1; - } - const json = await response.json(); - return json; + ret = "Could not fetch "+url + const response = await fetch(this.apiUrl + url).then( + response => response.json() + ).then(data => ret = data).catch( + error => console.error("Error: ", error) + ); + return ret } async dagens_lunch(spider) {