Open prodis opened 3 years ago
Similar error requests with error responses in the sibling Elixir library:
iex(1)> Correios.CEP.find_address("11111111")
{:error,
%Correios.CEP.Error{
message: "Unknown error",
reason: "CEP INVÁLIDO",
type: :unknown
}}
iex(2)> Correios.CEP.find_address("12345678")
{:error,
%Correios.CEP.Error{
message: "Postal code not found",
reason: "CEP NAO ENCONTRADO",
type: :postal_code_not_found
}}
iex(3)> Correios.CEP.find_address("07600000")
{:error,
%Correios.CEP.Error{
message: "Postal code not found",
reason: "Empty response",
type: :postal_code_not_found
}}
Related to https://github.com/prodis/correios-cep/issues/27.
Currently the response is an empty hash with no information about the error.
Some examples: