{"record":{"id":"616f09de6db48f29","repo":"tonhowtf/omniget","slug":"study-music-sc-error","errorCode":null,"errorMessage":"[study-music] sc error:","messagePattern":"\\[study-music\\] sc error:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/lib/study-music-components/SoundCloudError.svelte","lineNumber":32,"sourceCode":"    try {\n      const res = await studySoundcloudHumanizeError({ error: err });\n      humanized = res.humanized;\n    } catch {}\n  }\n\n  async function openInSoundcloud() {\n    if (!trackUrl) return;\n    try {\n      const { openUrl } = await import(\"@tauri-apps/plugin-opener\");\n      await openUrl(trackUrl);\n    } catch {\n      window.open(trackUrl, \"_blank\", \"noopener,noreferrer\");\n    }\n  }\n\n  $effect(() => {\n    void resolve(error);\n    console.warn(\"[study-music] sc error:\", error);\n  });\n</script>\n\n<div class=\"sc-error\" role=\"alert\">\n  <div class=\"icon\" aria-hidden=\"true\">\n    <svg viewBox=\"0 0 24 24\" width=\"28\" height=\"28\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n      <path d=\"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z\" />\n      <line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\" />\n      <line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\" />\n    </svg>\n  </div>\n  <div class=\"body\">\n    <p class=\"kicker\">SoundCloud</p>\n    <p class=\"msg\">{humanized}</p>\n    <p class=\"hint\">Tentamos outras qualidades antes de mostrar esse aviso.</p>\n    <div class=\"actions\">\n      {#if onRetry}\n        <button type=\"button\" class=\"btn primary\" onclick={onRetry}>Tentar de novo</button>","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src/lib/study-music-components/SoundCloudError.svelte#L14-L50","documentation":"SoundCloud track playback/lookup failed inside the study-music player and the YoutubeError-style error component was mounted. In a $effect it calls resolve(error) to map the raw error into a display object and logs the raw value with console.warn.","triggerScenarios":"A SoundCloud source fails to resolve or stream (bad track URL, removed/private track, API rate limit or auth failure), and the player store renders SoundCloudError with the raw error prop.","commonSituations":"Deleted or region-blocked SoundCloud tracks, expired stream URLs, network failures, or SoundCloud API client-id changes breaking resolution.","solutions":["Inspect the logged raw error to identify resolve vs network vs auth failure","Retry resolving the track (stream URLs expire)","Fall back to opening the track in the browser via the provided button","Skip the track (player auto-skip on error if enabled)"],"exampleFix":"// before\n$effect(() => {\n  void resolve(error);\n  console.warn(\"[study-music] sc error:\", error);\n});\n// after\n$effect(() => {\n  const resolved = resolve(error);\n  if (resolved.retryable) console.warn(\"[study-music] sc error (retryable):\", error);\n});","handlingStrategy":"fallback","validationCode":"if (!track?.permalink_url || !track.id) throw new Error(\"invalid soundcloud track\");","typeGuard":"function isResolvableScTrack(t: unknown): t is ScTrack {\n  return !!t && typeof t === \"object\" && \"id\" in t && typeof (t as ScTrack).permalink_url === \"string\";\n}","tryCatchPattern":"try {\n  await scPlayer.play(track);\n} catch (e) {\n  console.warn(\"[study-music] sc error:\", e);\n  showFallbackLink(track.permalink_url); // open in browser\n  skipToNextTrack();\n}","preventionTips":["Enable auto-skip-on-error in player settings","Refresh stream URLs before playback","Validate track metadata before attempting playback","Provide an open-in-browser fallback for unplayable tracks"],"tags":["soundcloud","audio-player","error-ui"],"backgroundTag":"upstream-api-error","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}