1
0
Fork 0

Handle faraday errors

This commit is contained in:
Savater Sebastien 2013-07-13 14:26:57 +04:00
parent 344dfdbe5c
commit b01795d55c
1 changed files with 2 additions and 0 deletions

View File

@ -4,6 +4,8 @@ module MusicBrainz
def get_contents(url)
response = http.get(url)
{ body: response.body, status: response.status }
rescue Faraday::Error::ClientError
{ body: nil, status: 500 }
end
end
end