Correios CEP 0.7.0 released! Improvements in error responses.
Correios CEP
allows to find Brazilian addresses by zip code, directly from Correios API. No HTML parsers.
Error responses were improved with the introduction of type
and message
attributes.
iex> Correios.CEP.find_address("00000-000")
{:error,
%Correios.CEP.Error{
type: :postal_code_not_found,
message: "Postal code not found",
reason: "CEP NAO ENCONTRADO"
}}
iex> Correios.CEP.find_address("1098PR")
{:error,
%Correios.CEP.Error{
type: :postal_code_invalid,
message: "Postal code in invalid format",
reason: nil
}}
Changelog for version 0.7.0
:
Changed
- Improve error responses. Issue #18
Check it out at: