-
Notifications
You must be signed in to change notification settings - Fork 94
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
refactor: use odataerrors and azcore response error #929
Conversation
clientOpts := &armpolicy.ClientOptions{ | ||
ClientOptions: azcore.ClientOptions{ | ||
Transport: client, | ||
}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This http client is specific to the graph sdk and causes issues when used with the azure-sdk-for-go
clients, so removing it (this was not wired before either)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, what issues does it cause? This means we don't get logs for any calls this code makes right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the error
PUT https://management.azure.com/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/aramasedev/providers/Microsoft.KeyVault/vaults/<KEYVAULT_NAME>/providers/Microsoft.Authorization/roleAssignments/a91b41b8-f7ed-4eaa-8b57-34df7ccb90e4
--------------------------------------------------------------------------------
RESPONSE 400: 400 Bad Request
ERROR CODE: InvalidRequestContent
--------------------------------------------------------------------------------
{
"error": {
"code": "InvalidRequestContent",
"message": "The content of your request was not valid, and the original object could not be deserialized. Exception message: 'Unable to translate bytes [8B] at index 1 from specified code page to Unicode.'"
}
}
--------------------------------------------------------------------------------
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how using the wrapped client would cause that 🤔
Codecov Report
@@ Coverage Diff @@
## main #929 +/- ##
==========================================
+ Coverage 52.11% 53.43% +1.31%
==========================================
Files 36 36
Lines 2360 2302 -58
==========================================
Hits 1230 1230
+ Misses 1084 1026 -58
Partials 46 46
|
4d8be55
to
11ea507
Compare
11ea507
to
9c5a22a
Compare
Signed-off-by: Anish Ramasekar <[email protected]>
9c5a22a
to
156a58f
Compare
odataerrors.ODataError
for graph errors; contains the inner error and other details from additionalData that we were previously parsing because of sdk limitations.*azcore.ResponseError
as part of switch to the new sdk for role assignments and role definitions client.Validated it locally