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

[dashboard] peek parse response raise exception #4917

Closed
yittg opened this issue Aug 8, 2019 · 0 comments · Fixed by #4918
Closed

[dashboard] peek parse response raise exception #4917

yittg opened this issue Aug 8, 2019 · 0 comments · Fixed by #4918
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@yittg
Copy link
Contributor

yittg commented Aug 8, 2019

Describe the bug
dashboard peek message api parse response raise exception cause treat all message as a json string

To Reproduce
produce a literal string like something to a topic and peek it on dashboard, which would raise a ValueError: substring not found.

Expected behavior
RIGHT response

@yittg yittg added the type/bug The PR fixed a bug or issue reported a bug label Aug 8, 2019
sijie pushed a commit that referenced this issue Aug 14, 2019
Fixes #4917 

### Motivation

dashboard peek message api raise exception when format response cause treat all message as a JSON string

### Modifications

* format as JSON only if message is a JSON, 
* otherwise if message is printable, return the original message,
* otherwise print hex like command with --hex option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant