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

Use cosmos errors for the backend #1471

Closed
antho1404 opened this issue Nov 5, 2019 · 4 comments · Fixed by #1490
Closed

Use cosmos errors for the backend #1471

antho1404 opened this issue Nov 5, 2019 · 4 comments · Fixed by #1490
Assignees
Labels
enhancement New feature or request

Comments

@antho1404
Copy link
Member

In many places in the sdk backend we use normal errors instead of cosmos errors.
We eventually transform these errors into ErrInternal here

So we should consider using directly cosmos errors for the backend as they provide more context ErrInsufficientFunds, ErrInvalidAddress, ErrUnauthorized...

@antho1404 antho1404 added the enhancement New feature or request label Nov 5, 2019
@NicolasMahe
Copy link
Member

Even further, the handler functions of sdks should accept classic error and cosmos error type and transform the classic error to cosmos error automatically (like the querier functions)

@krhubert
Copy link
Contributor

krhubert commented Nov 12, 2019

So there is a draft (#1490). We need to decide what errors we want to have and just start using them. I put few example errors. We can create more over the time. Waiting for your commnet.

@NicolasMahe
Copy link
Member

After meeting with @krhubert, we decided to implement one new CodespaceType mesg that will contains error related to the project added value (running services, executions, processes) and not to error related to the blockchain (those one should use the sdk codespace defined by cosmos.

We will also implement new CodeType for any error that is not already defined by cosmos.

@krhubert
Copy link
Contributor

As discussed, we're gonna create those errors as needed during development, so closing this issue for now.

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

Successfully merging a pull request may close this issue.

3 participants