shkh/lastfm-go — pull request #2 by cfstras (2014-07-13 17:56:09+00:00)
Title: util: better error handling

last.fm sometimes responds with HTTP 500, 503, or other error codes. Reasons for this range from irregular varnish cache errors to broken software.

When lastfm-go gets such a result, it tries to parse them as xml, which results in an error `expected , got `.

This patch fixes that error by checking for HTTP 5xx error codes and directly returning them as an error.