From d698705352d7be094505c4bb7e57b4bae8142ec8 Mon Sep 17 00:00:00 2001 From: FragginWagon Date: Thu, 29 Jan 2026 14:31:53 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A0=EF=B8=8F=20Update=20error=20handling?= =?UTF-8?q?=20to=20support=20both=20string=20and=20Error=20object=20types?= =?UTF-8?q?=20in=20TournamentDetail=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/challonge/TournamentDetail.vue | 13 +++++++++++-- 1 file changed, 11 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 72e12bf..2c7bf62 100644 --- a/code/websites/pokedex.online/src/components/challonge/TournamentDetail.vue +++ b/code/websites/pokedex.online/src/components/challonge/TournamentDetail.vue @@ -35,7 +35,7 @@
⚠️ - {{ error }} + {{ errorMessage }}
@@ -69,7 +69,7 @@ const props = defineProps({ default: false }, error: { - type: String, + type: [String, Error], default: null }, isExpanded: { @@ -78,6 +78,15 @@ const props = defineProps({ } }); +/** + * Format error message from string or Error object + */ +const errorMessage = computed(() => { + if (!props.error) return ''; + if (typeof props.error === 'string') return props.error; + return props.error.message || 'An error occurred'; +}); + /** * Format tournament details as pretty-printed JSON */