added rescue for OpenURI HTTPErrors

pull/22/head
Adam Townsend 2023-10-12 18:26:13 -07:00
parent d78e361c29
commit 7eaa8eacf8
1 changed files with 3 additions and 0 deletions

3
app.rb
View File

@ -66,6 +66,9 @@ class App < Roda
rescue URI::BadURIError
response.status = 400
return {message: "invalid url parameter"}.to_json
rescue OpenURI::HTTPError
response.status = 400
return {message: "url not found"}.to_json
end