diff --git a/lib/customer_info_form.rb b/lib/customer_info_form.rb index 0b3ca108caa5c15d29eca318ebc038b26ec9e9a4..b5eec4e96dfeab19523a13070bda5486d2f2ae88 100644 --- a/lib/customer_info_form.rb +++ b/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) diff --git a/test/test_customer_info_form.rb b/test/test_customer_info_form.rb index 7d19e1ab617a31dc795b09f3401b9e595e372b17..72ce2e51acca5c71d3aeb736786be984494cc50e 100644 --- a/test/test_customer_info_form.rb +++ b/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