Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Message containing JSON #2255

Closed
j82w opened this issue Feb 25, 2021 · 1 comment · Fixed by #2303
Closed

Error Message containing JSON #2255

j82w opened this issue Feb 25, 2021 · 1 comment · Fixed by #2303
Labels
bug Something isn't working

Comments

@j82w
Copy link
Contributor

j82w commented Feb 25, 2021

The error message sometimes contain JSON formatted strings. This causes links and URIs to be escaped. The formatting should be changed to avoid the JSON formatting.

Example exception:
Microsoft.Azure.Cosmos.CosmosException : Response status code does not indicate success: Unauthorized (401); Substatus: 0; ActivityId: 24915954-9803-4100-b2e8-f2c62da94400; Reason: (Message: {"Errors":["The MAC signature found in the HTTP request is not the same as the computed signature. Server used following string to sign - 'get\ndocs\ndbs\/sampledb\/colls\/sample\/docs\/36a1777f-626d-485f-a1e9-f2971632317e\nthu, 25 feb 2021 04:49:48 gmt\n\n'. Learn more: https:\/\/aka.ms\/cosmosdb-tsg-mac-signature"]}

@j82w j82w added the bug Something isn't working label Feb 25, 2021
@j82w
Copy link
Contributor Author

j82w commented Mar 1, 2021

One solution is to treat the Error object as a JObect. Then have a string builder and iterate over the JObject print each property name and value as a new line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant