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

Streaming API error handling/reporting improvements #5141

Merged
merged 7 commits into from
Mar 24, 2020

Conversation

leo-da
Copy link
Contributor

@leo-da leo-da commented Mar 23, 2020

Items 1 and 2 of: #4521

question about error reporting:
akka/akka-http#3023

TODO

  • Update docs
  • Add test for binary message input

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

@leo-da leo-da force-pushed the leo-4521-error-reporting-1 branch from a2ddb61 to b20bd4e Compare March 24, 2020 14:44
leo-da added 4 commits March 24, 2020 12:37
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
@leo-da leo-da marked this pull request as ready for review March 24, 2020 18:20
const ws = new WebSocket("ws://localhost:7575/v1/stream/query", [subprotocol])

ws.on("open", function open() {
ws.send(`{"templateIds": ["Iou:Iou"]}`)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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"]}))
    })

Copy link
Contributor

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.

@leo-da
Copy link
Contributor Author

leo-da commented Mar 24, 2020

@hurryabit I am going to merge it as is. The doc update will be in a separate PR.

@mergify mergify bot merged commit a6a1e75 into master Mar 24, 2020
@mergify mergify bot deleted the leo-4521-error-reporting-1 branch March 24, 2020 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants