Skip to content

fix: prevent silent failures in handleSpotifyRequest and callers - #38

Open
nuggie wants to merge 1 commit into
marcelmarais:mainfrom
nuggie:fix/silent-error-handling
Open

fix: prevent silent failures in handleSpotifyRequest and callers#38
nuggie wants to merge 1 commit into
marcelmarais:mainfrom
nuggie:fix/silent-error-handling

Conversation

@nuggie

@nuggie nuggie commented Mar 11, 2026

Copy link
Copy Markdown

I had problems creating playlists with this MCP, so I asked Claude to fix it.
Maybe double check, but at least it helped me to be able to create playlists again.

Summary

  • handleSpotifyRequest silently swallows JSON parse errors and returns undefined, causing callers to report success when operations failed
  • createPlaylist crashes or returns fake success when API response is undefined
  • playMusic always reports "Started playing" even on API errors
  • addTracksToPlaylist reports success without confirmation

Changes

  • Add console.warn logging when JSON parse errors are caught
  • Add try-catch to playMusic to surface real errors
  • Validate createPlaylist response before accessing properties
  • Add confirmation check to addTracksToPlaylist

(created with Claude.ai Opus 4.6)

handleSpotifyRequest silently swallows JSON parse errors and returns
undefined, causing callers like createPlaylist, playMusic, and
addTracksToPlaylist to report success when operations actually failed.

- Add console.warn when JSON parse errors are caught in handleSpotifyRequest
- Add error handling to playMusic so API errors are surfaced
- Validate createPlaylist response before accessing result properties
- Add confirmation check to addTracksToPlaylist

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant