Open
Description
- Package Name: @azure/cosmos
- Package Version: latest
- Operating system: windows 11
- nodejs
- version: v20.17.0
- browser
- name/version:
- typescript
- version:
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://learn.microsoft.com
Describe the bug
When an "http:" endpoint is passed to the CosmosClient, it throws "Error: Cannot connect to http://x.x.x.x:xxxx while allowInsecureConnection is false.
". When I patched this, it further threw "TypeError: Protocol "http:" not supported. Expected "https:"
", which turned out to be a typo in how we were parsing the protocol from the Url. This error was not handled properly, so the test's unhandled exception event was fired, but it was throwing away the stack of the original exception by JSON.stringifying the error.
To Reproduce
Steps to reproduce the behavior:
- Configure tests to use "http://localhost:8081" (note HTTP, not HTTPS)
- Start tests
- Observe that tests output to STDERR some unuseful JSON and a stack trace to the undhandled exception handler (but not the original exception)
Expected behavior
A clear and concise description of what you expected to happen.
- I expect "http" endpoint to work
- I expect to get the source error when unhandled exceptions are handled
Screenshots
N/A
Additional context
I am working on a PR to address this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
This issue points to a problem in the data-plane of the library.Workflow: This issue is responsible by Azure service team.Issues that are reported by GitHub users external to the Azure organization.Workflow: This issue needs attention from Azure service team or SDK teamThe issue doesn't require a change to the product in order to be resolved. Most issues start as that