✨ Improve error message formatting and handling in TournamentDetail component
This commit is contained in:
@@ -99,9 +99,11 @@ const errorMessage = computed(() => {
|
|||||||
if (err.response) {
|
if (err.response) {
|
||||||
const status = err.response.status || err.status;
|
const status = err.response.status || err.status;
|
||||||
if (status === 401) return 'Authentication failed. Check your API key.';
|
if (status === 401) return 'Authentication failed. Check your API key.';
|
||||||
if (status === 403) return 'Access forbidden. You may not have permission to view this tournament.';
|
if (status === 403)
|
||||||
|
return 'Access forbidden. You may not have permission to view this tournament.';
|
||||||
if (status === 404) return 'Tournament not found.';
|
if (status === 404) return 'Tournament not found.';
|
||||||
if (status >= 500) return `Server error (${status}). Please try again later.`;
|
if (status >= 500)
|
||||||
|
return `Server error (${status}). Please try again later.`;
|
||||||
return `Error ${status}: ${err.response.statusText || 'Request failed'}`;
|
return `Error ${status}: ${err.response.statusText || 'Request failed'}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user