Improve emulator connection failure message#84
Open
mkrueger wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the user-facing error message shown when connecting to a local Cosmos DB emulator endpoint fails, providing actionable guidance (including a copy/paste alternate URL with the flipped scheme) to reduce confusion around HTTP vs HTTPS emulator setups.
Changes:
- Adds a new localized error string (
error-emulator_connection_failed) with emulator-specific troubleshooting guidance. - Updates
ShellInterpreter.ConnectAsyncto throw the emulator-specific message when an emulator connection attempt fails. - Adds unit tests validating the generated emulator failure message content and scheme-flip suggestion.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| CosmosDBShell/lang/en.ftl | Adds a new localized emulator-specific connection failure message with endpoint/alternate placeholders. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Core/ShellInterpreter.cs | Routes emulator connection failures to a new message generator and adds URI scheme-flip helper. |
| CosmosDBShell.Tests/CommandTests/ConnectCommandTests.cs | Adds tests asserting the emulator failure message includes key guidance and the correct alternate URL. |
- Preserve underlying exception as inner exception for emulator path so --verbose still shows diagnostics (addresses Copilot review feedback). - Expand emulator failure guidance: mention 'docker ps' check, the http://localhost:8080/alive health probe, the SDK HTTPS requirement, and a ready-to-paste docker run example with --protocol https. - Extend tests to cover the new content.
sevoku
approved these changes
May 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improves the failure message when
connectto a local Cosmos DB emulator endpoint fails.Before:
After (HTTPS attempt):
The suggested alternate URL flips the scheme so the user can copy-paste it.
Fixes #74