From ea2fdcb3165305c9f18b1a9be878dc9c9cab65b2 Mon Sep 17 00:00:00 2001 From: Jukka Lampikoski Date: Wed, 11 Mar 2026 14:03:06 +0200 Subject: [PATCH] =?UTF-8?q?Debug:=20n=C3=A4yt=C3=A4=20palvelimen=20raakava?= =?UTF-8?q?staus=20virhealertissa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script.js b/script.js index 9ef34bf..6aaae3a 100644 --- a/script.js +++ b/script.js @@ -36,7 +36,7 @@ async function apiCall(action, method = 'GET', body = null) { let data; try { data = JSON.parse(text); } catch (e) { console.error('API JSON parse error:', action, text.slice(0, 500)); - throw new Error('Palvelin palautti virheellisen vastauksen'); + throw new Error('API virhe (' + action + '): ' + text.slice(0, 300)); } if (!res.ok) throw new Error(data.error || 'Virhe'); return data;