rspec-coverage #22
@@ -69,9 +69,11 @@ class App < Roda
|
||||
rescue OpenURI::HTTPError
|
||||
response.status = 400
|
||||
return {message: "url not found"}.to_json
|
||||
rescue SocketError => e
|
||||
response.status = 400
|
||||
return {message: "url does not resolve"}.to_json
|
||||
end
|
||||
|
||||
|
||||
if links.filter(:url => url).first.nil?
|
||||
code = SecureRandom.urlsafe_base64 4
|
||||
links.insert(url: url, code: code)
|
||||
|
||||
Reference in New Issue
Block a user