Skip to content

Commit 6879d7e

Browse files
authored
Add another non-standard error code for RP registration (#20860)
1 parent 2d655f3 commit 6879d7e

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

sdk/azcore/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
### Bugs Fixed
2121
* Retry policy always clones the underlying `*http.Request` before invoking the next policy.
22-
* Added `MissingRegistrationForResourceProvider` to the list of error codes for unregistered resource providers.
22+
* Added some non-standard error codes to the list of error codes for unregistered resource providers.
2323

2424
### Other Changes
2525

sdk/azcore/arm/runtime/policy_register_rp.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ func (r *rpRegistrationPolicy) Do(req *azpolicy.Request) (*http.Response, error)
175175
var unregisteredRPCodes = []string{
176176
"MissingSubscriptionRegistration",
177177
"MissingRegistrationForResourceProvider",
178+
"Subscription Not Registered",
178179
}
179180

180181
func isUnregisteredRPCode(errorCode string) bool {

sdk/azcore/arm/runtime/policy_register_rp_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,11 @@ func TestRPRegistrationPolicyEnvironmentsInSubExceeded(t *testing.T) {
412412
require.EqualValues(t, 0, logEntries)
413413
}
414414

415+
func TestIsUnregisteredRPCode(t *testing.T) {
416+
require.True(t, isUnregisteredRPCode("Subscription Not Registered"))
417+
require.False(t, isUnregisteredRPCode("Your subscription isn't registered"))
418+
}
419+
415420
type fakeClient struct {
416421
ep string
417422
pl runtime.Pipeline

0 commit comments

Comments
 (0)