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

Added stack trace to CosmosException, ResponseMessage.ErrorMessage includes full exception info. #1213

Merged
merged 27 commits into from
Feb 28, 2020
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d4b9c9c
Removed Error since it is not being used anywhere.
Feb 11, 2020
ef9a94b
Removed error since it's not being used
Feb 11, 2020
87b363c
Refactored added new exception types
Feb 13, 2020
d1406ec
ResponseMessage.ErrorMessage will now return the full CosmosException…
Feb 14, 2020
eb37121
Fixed build issue
Feb 14, 2020
e8422e3
Renamed exception to add Cosmos to avoid confusion with Document name…
Feb 18, 2020
f783e54
Fixed exception handling and updated tests.
Feb 19, 2020
61905b1
Fixed tests
Feb 20, 2020
23a7a99
Fixed ExceptionWithStackTraceException to use original exception stac…
Feb 20, 2020
73d5632
Merge remote-tracking branch 'origin/master' into users/jawilley/diag…
Feb 20, 2020
97fae63
Fixed merge conflicts with latest
Feb 20, 2020
968fb97
Added diagnostic context to exceptions.
Feb 20, 2020
1162ce1
Fixed test for retail build
Feb 20, 2020
32343f2
Updated error message field in linq tests
Feb 21, 2020
064c1f5
Converted the stack trace to a string. Removed creating the stack tra…
Feb 21, 2020
a41b615
Updated changelog
Feb 21, 2020
0d2e970
Removed typed exceptions to avoid exposing internal types.
Feb 25, 2020
b5507e0
Merged to latest
Feb 25, 2020
74beae5
Adding transport client exception tests.
Feb 26, 2020
300872b
Update Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosExc…
j82w Feb 27, 2020
fce942a
Update Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosExc…
j82w Feb 27, 2020
680cb2e
Removed diagnostics from Response.ErrorMessage
Feb 27, 2020
c4e9490
Fixed unit test
Feb 27, 2020
46d9b1c
Adding Error object to CosmosException for back compatability.
Feb 27, 2020
4a72093
Adding unit test for Error handling
Feb 27, 2020
cad13c7
Fixed DocumentServiceResponse handling
Feb 28, 2020
553a761
Increased EndpointFailureMockTest wait time to avoid transient failures.
Feb 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added diagnostic context to exceptions.
  • Loading branch information
Jake Willey committed Feb 20, 2020
commit 968fb9725e38382c7f72aef2afb629f2256556a4
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ internal static Uri CreateLinkUri(CosmosClientContext clientContext, DatabaseCor
}
catch (CosmosException ex) when (ex.StatusCode == HttpStatusCode.NotFound)
{
throw new CosmosNotFoundException(ClientResources.DataEncryptionKeyNotFound, innerException: ex);
throw new CosmosNotFoundException(
ClientResources.DataEncryptionKeyNotFound,
diagnosticsContext: diagnosticsContext,
innerException: ex);
}

InMemoryRawDek inMemoryRawDek = await this.ClientContext.DekCache.GetOrAddRawDekAsync(
Expand Down Expand Up @@ -173,7 +176,10 @@ internal static Uri CreateLinkUri(CosmosClientContext clientContext, DatabaseCor
}
catch (CosmosException ex) when (ex.StatusCode == HttpStatusCode.NotFound)
{
throw new CosmosNotFoundException(ClientResources.DataEncryptionKeyNotFound, innerException: ex);
throw new CosmosNotFoundException(
ClientResources.DataEncryptionKeyNotFound,
diagnosticsContext: diagnosticsContext,
innerException: ex);
}

InMemoryRawDek inMemoryRawDek = await this.ClientContext.DekCache.GetOrAddRawDekAsync(
Expand Down Expand Up @@ -224,7 +230,8 @@ internal virtual byte[] GenerateKey(CosmosEncryptionAlgorithm encryptionAlgorith
InMemoryRawDek roundTripResponse = await this.UnwrapAsync(tempDekProperties, diagnosticsContext, cancellationToken);
if (!roundTripResponse.RawDek.SequenceEqual(key))
{
throw new CosmosBadRequestException(ClientResources.KeyWrappingDidNotRoundtrip);
throw new CosmosBadRequestException(ClientResources.KeyWrappingDidNotRoundtrip,
diagnosticsContext: diagnosticsContext);
}

return (keyWrapResponse.WrappedDataEncryptionKey, keyWrapResponse.EncryptionKeyWrapMetadata, roundTripResponse);
Expand Down