Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error response struct #18

Closed
prodis opened this issue May 23, 2020 · 3 comments · Fixed by #23
Closed

Improve error response struct #18

prodis opened this issue May 23, 2020 · 3 comments · Fixed by #23
Assignees

Comments

@prodis
Copy link
Owner

prodis commented May 23, 2020

Current error struct:

%Correios.CEP.Error{
  reason: "CEP NAO ENCONTRADO"
}

To be implemented:

%Correios.CEP.Error{
  type: :postal_code_not_found,
  message: "Postal code not found",
  reason: "CEP NAO ENCONTRADO"
}

Other know errors:

%Correios.CEP.Error{
  type: :postal_code_required,
  message: "Postal code is required",
  reason: nil
}

%Correios.CEP.Error{
  type: :postal_code_invalid,
  message: "Postal code is invalid",
  reason: nil
}

Unexpected errors returned by Correios API:

%Correios.CEP.Error{
  type: :unexpected_error,
  message: "Unexpected error",
  reason: "[Any error response returned by Correios API]"
}
@lcezermf
Copy link
Contributor

lcezermf commented Jun 9, 2020

Hey @prodis can I try to solve this one?

@prodis
Copy link
Owner Author

prodis commented Jun 10, 2020

Yes, thanks. 🙂

I have added more details to the specification. Let me know if any doubts.

@lcezermf
Copy link
Contributor

lcezermf commented Jul 2, 2020

Just to let you know, I already start developing this fix, sorry for the lack of return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants