From 7eaa8eacf872adecd313363b7c7557e8e7c73e0c Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Thu, 12 Oct 2023 18:26:13 -0700 Subject: [PATCH] added rescue for OpenURI HTTPErrors --- app.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app.rb b/app.rb index 6bd5136..d1ab2c6 100644 --- a/app.rb +++ b/app.rb @@ -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