Handle faraday errors
This commit is contained in:
parent
344dfdbe5c
commit
b01795d55c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue