-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
R4R: Improve SDK Error Messages & Allow Unicode #3604
Conversation
enc.SetEscapeHTML(false) | ||
|
||
if err := enc.Encode(jsonErr); err != nil { | ||
panic(errors.Wrap(err, "failed to encode ABCI error log")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
Will this return an actual JSON instead of |
@faboweb I don't follow. This improves the error messages and displays unicode (in the JSON response). e.g.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way better error messages here
Codecov Report
@@ Coverage Diff @@
## develop #3604 +/- ##
===========================================
- Coverage 61.46% 61.44% -0.02%
===========================================
Files 186 186
Lines 13981 13990 +9
===========================================
+ Hits 8593 8596 +3
- Misses 4841 4847 +6
Partials 547 547 |
stringifiedJSON := string(bz) | ||
return stringifiedJSON | ||
|
||
return strings.TrimSpace(buff.String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the @cosmos/cosmos-ui was hoping for something more like:
{
"codespace": "sdk",
"code": 10,
"message": "You are trying to send more stake than you own."
}
(from #3601)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the expected response?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for following up @jbibla! Are you saying you wish it to be pretty JSON and indented? It already is JSON.
<
)Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added entries in
PENDING.md
with issue #rereviewed
Files changed
in the github PR explorerFor Admin Use: