From 8801b62252b956aa1621d13dc697efe80a95af10 Mon Sep 17 00:00:00 2001 From: FragginWagon Date: Thu, 29 Jan 2026 14:34:40 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Improve=20error=20handling=20and?= =?UTF-8?q?=20logging=20for=20tournament=20detail=20loading=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/challonge/TournamentDetail.vue | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/code/websites/pokedex.online/src/components/challonge/TournamentDetail.vue b/code/websites/pokedex.online/src/components/challonge/TournamentDetail.vue index 5f0191f..14fa9ca 100644 --- a/code/websites/pokedex.online/src/components/challonge/TournamentDetail.vue +++ b/code/websites/pokedex.online/src/components/challonge/TournamentDetail.vue @@ -107,8 +107,32 @@ const errorMessage = computed(() => { return `Error ${status}: ${err.response.statusText || 'Request failed'}`; } - // Fallback - return err.toString() || 'An error occurred loading tournament details'; + // Fallback - try multiple approaches + + // Try to get status code directly + if (err.status) { + return `Error ${err.status}: Request failed`; + } + + // Try to stringify for debugging + try { + const errorStr = JSON.stringify(err); + if (errorStr && errorStr !== '{}') { + console.error('Tournament detail error:', err); + return 'An error occurred. Check browser console for details.'; + } + } catch (e) { + // Ignore stringify errors + } + + // Use toString if available and not [object Object] + const str = err.toString ? err.toString() : String(err); + if (str && str !== '[object Object]') { + return str; + } + + console.error('Unable to parse error:', err); + return 'An error occurred loading tournament details. Check console for details.'; }); /**