nickspeal / musicThisWeek

A Web Service that generates a Spotify playlist of bands that are playing in your area in the near future
3 stars 2 forks source link

Incorrect handling of ConnectionError #44

Open nickspeal opened 8 years ago

nickspeal commented 8 years ago
Internal Server Error: /search/
Traceback (most recent call last):
  File "/Users/Nick/.virtualenvs/mtw/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/Users/Nick/.virtualenvs/mtw/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/Nick/ws/musicThisWeek/music_this_week_app/views.py", line 125, in search
    (url, error) = backend.execute(pc, search_args)
  File "/Users/Nick/ws/musicThisWeek/music_this_week_app/backend/__init__.py", line 40, in execute
    song_list = searcher.get_song_list(artist_URIs, N=99, order='shuffled')
  File "/Users/Nick/ws/musicThisWeek/music_this_week_app/backend/spotifyHandler.py", line 114, in get_song_list
    tracks = tracks + self.find_top_tracks(a, N=number_of_tracks_per_artist)
  File "/Users/Nick/ws/musicThisWeek/music_this_week_app/backend/spotifyHandler.py", line 137, in find_top_tracks
    except ConnectionError as e:
NameError: global name 'ConnectionError' is not defined
esmason commented 8 years ago

probably need to import it from Requests http://docs.python-requests.org/en/master/_modules/requests/exceptions/