Expose ScriptLog on CosmosException
See original GitHub issueWhen execution of a stored procedure fails, it would be useful to be able to see the script log. However, even though it’s exposed on StoredProcedureResponse<T>
, it’s not exposed on CosmosException
.
Describe the solution you’d like
A ScriptLog
property on CosmosException
.
Describe alternatives you’ve considered The script log is accessible from the headers, but it’s not very convenient, because you need to remember the header name, and manually escape the value:
var scriptLog = Uri.UnescapeDataString(ex.Headers["x-ms-documentdb-script-log-results"] ?? string.Empty);
Additional context N/A
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
[BUG] CosmosException when using azure-spring-data- ...
Describe the bug When defining a repository with a query method containing repeated parameters, the query execution will throw a ...
Read more >StoredProcedureRequestOptions.EnableScriptLogging ...
Gets or sets the EnableScriptLogging for the current request in the Azure Cosmos DB service. ... To log, use the following in store...
Read more >Microsoft Azure CosmostDB Script Explorer console.log
I've found a getScriptLog method to get the console. Log () statement in the Azure Cosmos DB Stored Proceduce official documentation.
Read more >RequestOptions.EnableScriptLogging Property
EnableScriptLogging is used to enable/disable logging in JavaScript stored procedures. By default script logging is disabled. The log can also be accessible ...
Read more >Troubleshoot an application using the Azure Cosmos DB ...
NET script; Run a script to create menu-driven options to insert and delete ... Sign into the portal using the Microsoft credentials associated...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think the best option would be to expose a
CosmosStoredProcedureException : CosmosException
with the additional property. Adding it to the base exception doesn’t make since with it only returning for a single API in the SDK.@thomaslevesque what is the reason you are using stored procedure instead of Transactional Batch or Bulk?
Please reopen. The issue is still relevant, inactivity or not.