-
Notifications
You must be signed in to change notification settings - Fork 205
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
Streaming API error handling/reporting improvements #5141
Conversation
a2ddb61
to
b20bd4e
Compare
changelog_begin [JSON API - Experimental] Change Streaming API error format to match synchronous API: ``{"status": <400 | 401 | 404 | 500>, "errors": <JSON array of strings> }``. See #4521 changelog_end
docs/source/json-api/index.rst
Outdated
const ws = new WebSocket("ws://localhost:7575/v1/stream/query", [subprotocol]) | ||
|
||
ws.on("open", function open() { | ||
ws.send(`{"templateIds": ["Iou:Iou"]}`) |
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.
I think you would typically write the JS object as an object and then encode it to JSON, yes?
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.
this is Javascript, no types who cares :) but yeah JSON.stringify
should do the trick. I will change it.
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.
ws.on("open", function open() {
ws.send(JSON.stringify({templateIds: ["Iou:Iou"]}))
})
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.
For sure :) you can at least catch dumb syntax typos like missing }
or "
this way.
@hurryabit I am going to merge it as is. The doc update will be in a separate PR. |
Items 1 and 2 of: #4521
question about error reporting:
akka/akka-http#3023
TODO
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tagsNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.