Catch only NotFound

Stephen Paul Weber created

Otherwise report the error

Change summary

lib/customer_info_form.rb       | 2 +-
test/test_customer_info_form.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

Detailed changes

lib/customer_info_form.rb 🔗

@@ -25,7 +25,7 @@ class CustomerInfoForm
 	end
 
 	def find_customer_one(q)
-		@customer_repo.find_by_format(q).catch { nil }
+		@customer_repo.find_by_format(q).catch_only(CustomerRepo::NotFound) { nil }
 	end
 
 	def find_customer_by_phone(value)

test/test_customer_info_form.rb 🔗

@@ -26,7 +26,7 @@ class FakeRepo
 				find_by(:tel, key.tel)
 			else
 				raise "Un-faked format: #{s}"
-			end || raise("No Customer")
+			end || raise(CustomerRepo::NotFound, "No Customer")
 		end
 	end
 end