indicador de conexion y logging
This commit is contained in:
@@ -47,7 +47,16 @@ export const useMusicStore = defineStore('music', {
|
||||
const response = await $fetch<{ tracks: Track[] }>('/api/music')
|
||||
this.tracks = response.tracks || []
|
||||
} catch (e: any) {
|
||||
this.error = e?.message || 'Failed to load tracks'
|
||||
const errorMsg = e?.message || 'Failed to load tracks'
|
||||
this.error = errorMsg
|
||||
|
||||
// Check if it's an auth error
|
||||
if (e?.statusCode === 401 || e?.statusCode === 403 ||
|
||||
errorMsg.includes('401') || errorMsg.includes('403') ||
|
||||
errorMsg.includes('Unauthorized')) {
|
||||
console.warn('[Music Store] Authentication error detected')
|
||||
// The useAuth composable will be notified via watch in components
|
||||
}
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user