You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnresp, fmt.Errorf("failed auto registering Resource Provider: %s. Original error: %s", regErr, err)
The serviceError that maintains the code "MissingSubscriptionRegistration" is clobbered on the line called out above. This makes it really difficult for users of this client code to properly respond to failures where the customer is not registered for a required RP for our service.
In my RPs case, we are considering doing a string compare for "MissingSubscriptionRegistration" in the error returned, which is very fragile.
Do you have any recommendations on how best to identify "MissingSubscriptionRegistration"?
The easy fix I see is to replace rp.go:67 with the following: return resp, fmt.Errorf("failed auto registering Resource Provider: %s. Original error: %w", regErr, err)
%w allows for the error to be cleanly unwrapped, as opposed to being embedded as a string, however its only available from go1.13 and onwards.
More details on %w below: https://go.dev/blog/go1.13-errors#:~:text=Wrapping%20errors%20with%20%25w
Thoughts?
The text was updated successfully, but these errors were encountered:
go-autorest/autorest/azure/rp.go
Line 67 in b3899c1
The serviceError that maintains the code "MissingSubscriptionRegistration" is clobbered on the line called out above. This makes it really difficult for users of this client code to properly respond to failures where the customer is not registered for a required RP for our service.
In my RPs case, we are considering doing a string compare for "MissingSubscriptionRegistration" in the error returned, which is very fragile.
Do you have any recommendations on how best to identify "MissingSubscriptionRegistration"?
The easy fix I see is to replace rp.go:67 with the following:
return resp, fmt.Errorf("failed auto registering Resource Provider: %s. Original error: %w", regErr, err)
%w allows for the error to be cleanly unwrapped, as opposed to being embedded as a string, however its only available from go1.13 and onwards.
More details on %w below:
https://go.dev/blog/go1.13-errors#:~:text=Wrapping%20errors%20with%20%25w
Thoughts?
The text was updated successfully, but these errors were encountered: