From bad3b7cbb013e2b82f66e317aeaa2b3be40566ed Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Thu, 31 Mar 2022 12:17:32 -0700 Subject: [PATCH] Wrap error when registering RP fails (#691) The allows callers to get at the underlying error. --- autorest/azure/rp.go | 2 +- autorest/go.mod | 2 +- autorest/go.sum | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/autorest/azure/rp.go b/autorest/azure/rp.go index c6d39f686..5b52357f9 100644 --- a/autorest/azure/rp.go +++ b/autorest/azure/rp.go @@ -64,7 +64,7 @@ func DoRetryWithRegistration(client autorest.Client) autorest.SendDecorator { if re.ServiceError != nil && re.ServiceError.Code == "MissingSubscriptionRegistration" { regErr := register(client, r, re) if regErr != nil { - return resp, fmt.Errorf("failed auto registering Resource Provider: %s. Original error: %s", regErr, err) + return resp, fmt.Errorf("failed auto registering Resource Provider: %s. Original error: %w", regErr, err) } } } diff --git a/autorest/go.mod b/autorest/go.mod index 5c2ef4b8b..680b9676f 100644 --- a/autorest/go.mod +++ b/autorest/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( github.com/Azure/go-autorest v14.2.0+incompatible github.com/Azure/go-autorest/autorest/adal v0.9.18 - github.com/Azure/go-autorest/autorest/mocks v0.4.1 + github.com/Azure/go-autorest/autorest/mocks v0.4.2 github.com/Azure/go-autorest/logger v0.2.1 github.com/Azure/go-autorest/tracing v0.6.0 github.com/golang-jwt/jwt/v4 v4.2.0 // indirect diff --git a/autorest/go.sum b/autorest/go.sum index 0ebf4d182..4bb88d68c 100644 --- a/autorest/go.sum +++ b/autorest/go.sum @@ -4,8 +4,9 @@ github.com/Azure/go-autorest/autorest/adal v0.9.18 h1:kLnPsRjzZZUF3K5REu/Kc+qMQr github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw= +github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU= github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=