You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a standard value for error messages in REST responses
Problem Definition
Even thought the new object format makes it easier to get each of the components of an error (eg: codespace, code, abci_code, and message) Currently clients have to parse the content of the message value to get the desired format. For example:
{"codespace":1,"code":12,"abci_code":65548,"message":"checkTx failed: Error{out of gas in location: WritePerByte}"}
This is caused by a series of added messages to the error, such as fmt.Sprintf("checkTx failed: %s", err.Error())
Ref to voyager issue for parsing Errors: luniehq/lunie#1131
Ref to user feedback issue about the same problem: #1892
Proposal
refactor to use utils.WriteErrorResponse(w http.ResponseWriter, status int, msg string) as the desired format for errors
additional msgs should go inside the error msg: eg: "message":"Error{checkTx failed; out of gas in location: WritePerByte}"
For Admin Use
Not duplicate issue
Appropriate labels applied
Appropriate contributors tagged
Contributor assigned/self-assigned
The text was updated successfully, but these errors were encountered:
Summary
Create a standard value for error messages in REST responses
Problem Definition
Even thought the new object format makes it easier to get each of the components of an error (eg:
codespace
,code
,abci_code
, andmessage
) Currently clients have to parse the content of themessage
value to get the desired format. For example:This is caused by a series of added messages to the error, such as
fmt.Sprintf("checkTx failed: %s", err.Error())
Ref to voyager issue for parsing Errors: luniehq/lunie#1131
Ref to user feedback issue about the same problem: #1892
Proposal
utils.WriteErrorResponse(w http.ResponseWriter, status int, msg string)
as the desired format for errors"message":"Error{checkTx failed; out of gas in location: WritePerByte}"
For Admin Use
The text was updated successfully, but these errors were encountered: