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

Machine readable error messages from the LCD #2044

Closed
4 tasks
faboweb opened this issue Aug 15, 2018 · 6 comments
Closed
4 tasks

Machine readable error messages from the LCD #2044

faboweb opened this issue Aug 15, 2018 · 6 comments

Comments

@faboweb
Copy link
Contributor

faboweb commented Aug 15, 2018

Summary

Errors delivered from the LCD have a bunch of text wrapping the actual error message. We should deliver JSON error messages so clients can read the error and display it to the user.

Problem Definition

Proposal


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alexanderbez
Copy link
Contributor

@faboweb can you attach an example of existing and desired output/error example?

@faboweb
Copy link
Contributor Author

faboweb commented Aug 15, 2018

Current:

  checkTx failed: (262245) Msg 0 failed: === ABCI Log ===
  Codespace: 4
  Code:      101
  ABCICode:  262245
  Error:     --= Error =--
  Data: common.FmtError{format:"validator for this address is currently revoked", args:[]interface {}(nil)}
  Msg Traces:
  --= /Error =--

  === /ABCI Log ===

Expected:

{
  "code": 1,
  "abci_code": 262245,
  "message": "checkTx failed: validator for this address is currently revoked"
}

@faboweb
Copy link
Contributor Author

faboweb commented Aug 15, 2018

@cosmos/cosmos-ui any other recommendations?

@alexanderbez
Copy link
Contributor

Thanks @faboweb !

@fedekunze
Copy link
Collaborator

I'm totally approve this. Parsing each distinct error msg completely avoidable

@fedekunze
Copy link
Collaborator

fedekunze commented Aug 17, 2018

Implemented in types/errors.go #L247

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

No branches or pull requests

3 participants