Repository navigation
Show readable Azure and Cosmos DB service errors - #283
Merged
Mike Krüger (mkrueger) merged 4 commits intoNov 5, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Mike Krüger (mkrueger)
requested review from
a team
and
a balanced review from Copilot
November 4, 2026 08:09
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The early return drops actionable inner-error details from CLI output, so recursive display formatting must be preserved while summary messages remain limited to the exception’s own sanitized message.
1 open issue
What changed in this PR
This PR addresses #272 by making Azure and Cosmos DB service failures easier to read in CLI and MCP output while retaining original exceptions for diagnostics.
Changes:
- Extract actionable messages from recognized nested service-error payloads.
- Limit full MCP exception logging to
--verbose. - Add regression coverage and document the error-output behavior.
| File | Description |
|---|---|
| docs/mcp.md | Documents concise errors and verbose logging. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Mcp/ToolOperations.cs | Uses concise error messages and conditional exception logging. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Mcp/McpResponseFactory.cs | Summarizes service errors in MCP responses. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Core/ShellInterpreter.cs | Wraps service exceptions with command context. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Core/CommandException.cs | Extracts service messages and separates summary formatting. |
| CosmosDBShell.Tests/ToolOperationsCallToolTests.cs | Tests MCP error responses and verbose logging. |
| CosmosDBShell.Tests/Shell/ExecuteCommandExceptionTests.cs | Tests CLI service-error rendering. |
| CosmosDBShell.Tests/Shell/CommandExceptionServiceErrorTests.cs | Tests payload extraction, fallback, and exception preservation. |
| CosmosDBShell.Tests/McpResponseFactoryTests.cs | Tests concise errors with structured results. |
| CHANGELOG.md | Records the service-error readability improvement. |
Review effort: Balanced
Code coverage overviewLanguages: C# C# / code-coverage/dotnet
View coverage of the 3 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Vsevolod Kukol (sevoku)
approved these changes
Nov 5, 2026
Mike Krüger (mkrueger)
deleted the
dev/mkrueger/fix/272-readable-service-errors
branch
November 5, 2026 11:40
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.

Summary
--verboseflag.Fixes #272.
Validation
git diff --checkpasses.