question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose ScriptLog on CosmosException

See original GitHub issue

When 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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
j82wcommented, Oct 5, 2020

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?

0reactions
thomaslevesquecommented, Dec 15, 2021

Please reopen. The issue is still relevant, inactivity or not.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found