added rescue for OpenURI HTTPErrors
parent
d78e361c29
commit
7eaa8eacf8
3
app.rb
3
app.rb
|
|
@ -66,6 +66,9 @@ class App < Roda
|
||||||
rescue URI::BadURIError
|
rescue URI::BadURIError
|
||||||
response.status = 400
|
response.status = 400
|
||||||
return {message: "invalid url parameter"}.to_json
|
return {message: "invalid url parameter"}.to_json
|
||||||
|
rescue OpenURI::HTTPError
|
||||||
|
response.status = 400
|
||||||
|
return {message: "url not found"}.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue