Closed antho1404 closed 4 years ago
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)
So there is a draft (https://github.com/mesg-foundation/engine/pull/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.
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.
As discussed, we're gonna create those errors as needed during development, so closing this issue for now.
In many places in the sdk backend we use normal errors instead of cosmos errors. We eventually transform these errors into
ErrInternal
hereSo we should consider using directly cosmos errors for the backend as they provide more context
ErrInsufficientFunds
,ErrInvalidAddress
,ErrUnauthorized
...