summaryrefslogtreecommitdiffstats
path: root/lib/cepis.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cepis.rb')
-rw-r--r--lib/cepis.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/cepis.rb b/lib/cepis.rb
index 7b2cc5a..39cd831 100644
--- a/lib/cepis.rb
+++ b/lib/cepis.rb
@@ -27,8 +27,11 @@ require_relative "cepis/client"
#
# begin
# address = Cepis.lookup(cep_from_form)
-# rescue Cepis::CEPNotFound
-# # the CEP does not exist: ask the user for another
+# rescue Cepis::CEPNotFound => e
+# # the CEP does not exist: ask the user for another. e.faixa, when the
+# # API sends it, names the municipality whose numbers surround the one
+# # that failed — context for the error, never an address.
+# puts "did you mean somewhere in #{e.faixa.localidade}?" if e.faixa
# rescue Cepis::Error
# # network, server, rate limit: retry later
# end