Enhance CosmosDB storage error messages with actionable context#780
Merged
Enhance CosmosDB storage error messages with actionable context#780
Conversation
Co-authored-by: cleemullins <1165321+cleemullins@users.noreply.github.com>
Co-authored-by: cleemullins <1165321+cleemullins@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…Storage.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…Storage.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nner exception handling Co-authored-by: cleemullins <1165321+cleemullins@users.noreply.github.com>
…orDefinition to interface Co-authored-by: cleemullins <1165321+cleemullins@users.noreply.github.com>
Co-authored-by: cleemullins <1165321+cleemullins@users.noreply.github.com>
…y indices Co-authored-by: cleemullins <1165321+cleemullins@users.noreply.github.com>
…rror properties Co-authored-by: cleemullins <1165321+cleemullins@users.noreply.github.com>
Co-authored-by: cleemullins <1165321+cleemullins@users.noreply.github.com>
Co-authored-by: cleemullins <1165321+cleemullins@users.noreply.github.com>
Co-authored-by: cleemullins <1165321+cleemullins@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve error message quality in errorHelper.ts
Enhance CosmosDB storage error messages with actionable context
Nov 19, 2025
Base automatically changed from
copilot/extract-error-codes-cosmosdb
to
main
November 19, 2025 21:40
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances error messages in the CosmosDB storage error helper module by transforming terse error descriptions into comprehensive, actionable messages. The enhanced messages provide specific context, root causes, and remediation steps to improve developer troubleshooting experience.
Key Changes:
- Enhanced all 20 error definitions with detailed context, root causes, and remediation guidance
- Added concrete examples and configuration requirements (e.g., endpoint URL formats, partition key paths)
- Updated test assertions to validate the new enhanced error descriptions
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/agents-hosting-storage-cosmos/src/errorHelper.ts | Enhanced error message descriptions for all 20 error definitions with actionable context and troubleshooting guidance. Contains a critical bug with duplicate property definition. |
| packages/agents-hosting-storage-cosmos/test/errorHelper.test.ts | Updated test assertions to match the new enhanced error descriptions for three configuration-related errors. |
Comments suppressed due to low confidence (1)
packages/agents-hosting-storage-cosmos/src/errorHelper.ts:144
- This property is overwritten by another property in the same object literal.
description: 'Bad request error while reading from the Cosmos DB container. This usually indicates a configuration mismatch: the container may be non-partitioned or uses a partition key path other than "/id". Verify your container\'s partition key configuration matches the storage implementation requirements.',
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
cleemullins
approved these changes
Nov 20, 2025
Contributor
|
These changes were already part of a different PR. |
Contributor
|
I was wrong about htis one too. Re-reviewing! |
benbrown
approved these changes
Dec 18, 2025
ceciliaavila
approved these changes
Dec 18, 2025
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.
This pull request improves the clarity and usefulness of error messages in the Cosmos DB storage adapter by updating error descriptions to be more detailed and actionable. It also updates the corresponding unit tests to match the new error messages. These changes help developers diagnose configuration and runtime issues more easily.
Enhanced error messages for configuration and runtime issues:
errorHelper.tsto provide clearer guidance for missing or invalid configuration options (e.g., missingCosmosDbPartitionedStorageOptions, missingendpoint, missing credentials, database/container IDs, and key parameters). The new messages specify required properties and offer suggestions for resolution. [1] [2] [3] [4] [5] [6]compatibilityModeandkeySuffix, or invalid characters inkeySuffix. [1] [2]Unit test updates:
errorHelper.test.tsto match the new, more detailed error descriptions, ensuring test coverage remains accurate after the changes.Error messages inerrorHelper.tswere too terse, making troubleshooting difficult. Enhanced all 20 error definitions to provide specific context, root causes, and remediation steps based on code usage patterns.Changes
Configuration Errors
https://your-account.documents.azure.com:443/)InvalidKeySuffixCharactersOperation Errors
read(),write())StoreItems, key arrays)Runtime Errors
Example
Before:
After:
Testing
Updated test assertions to match new descriptions. All tests passing.
Original prompt
Created from VS Code via the GitHub Pull Request extension.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.