From 483b5c6b41a04728484ba5d23348161966e84b5b Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 20 Oct 2021 13:21:35 -0500 Subject: [PATCH] Better CNAM fail error message --- lib/customer_repo.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/customer_repo.rb b/lib/customer_repo.rb index 4768f8e7451a3699c10cfdeb4f49b01d9cc9d7d7..10e487298089325afde7da87e658fc327a20b870 100644 --- a/lib/customer_repo.rb +++ b/lib/customer_repo.rb @@ -73,6 +73,8 @@ class CustomerRepo use_type: "RESIDENTIAL", visibility: "PUBLIC" } } ) + rescue BandwidthIris::Errors::GenericError + raise "Could not set CNAM, please contact support" end def put_transcription_enabled(customer, transcription_enabled) @@ -82,9 +84,8 @@ class CustomerRepo end def put_fwd(customer, customer_fwd) - @sgx_repo.put_fwd( - customer.customer_id, customer.registered?.phone, customer_fwd - ) + tel = customer.registered?.phone + @sgx_repo.put_fwd(customer.customer_id, tel, customer_fwd) end protected @@ -121,8 +122,7 @@ protected result = @db.query_defer(SQL, [customer_id]) EMPromise.all([@sgx_repo.get(customer_id), result]).then do |(sgx, rows)| data = hydrate_plan( - customer_id, - rows.first&.transform_keys(&:to_sym) || {} + customer_id, rows.first&.transform_keys(&:to_sym) || {} ) Customer.new(customer_id, Blather::JID.new(jid), sgx: sgx, **data) end