From dc34beb594fc5a5c535cda450fa7543127339458 Mon Sep 17 00:00:00 2001 From: Simon Richardson Date: Fri, 25 Oct 2024 14:44:28 +0100 Subject: [PATCH] fix: use internal errors package --- apiserver/facades/client/application/application_test.go | 2 +- internal/worker/domainservices/worker.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apiserver/facades/client/application/application_test.go b/apiserver/facades/client/application/application_test.go index 8f1743501d8..0a15ea2bd87 100644 --- a/apiserver/facades/client/application/application_test.go +++ b/apiserver/facades/client/application/application_test.go @@ -105,7 +105,7 @@ func (s *applicationSuite) makeAPI(c *gc.C) { Type: model.IAAS, } registry := provider.NewStorageProviderRegistry(env) - domainServicesGetter := s.DomainServicesGetter(c, s.NoopObjectStore(c)) + domainServicesGetter := s.DomainServicesGetter(c, s.NoopObjectStore(c), s.NoopLeaseManager(c)) storageService := domainServicesGetter.ServicesForModel(model.UUID(st.ModelUUID())).Storage() applicationService := domainServices.Application() diff --git a/internal/worker/domainservices/worker.go b/internal/worker/domainservices/worker.go index 82f9d9f9a27..711cd5f5655 100644 --- a/internal/worker/domainservices/worker.go +++ b/internal/worker/domainservices/worker.go @@ -20,6 +20,7 @@ import ( "github.com/juju/juju/core/providertracker" "github.com/juju/juju/core/storage" domainservices "github.com/juju/juju/domain/services" + internalerrors "github.com/juju/juju/internal/errors" "github.com/juju/juju/internal/services" internalstorage "github.com/juju/juju/internal/storage" ) @@ -254,12 +255,12 @@ func (s modelApplicationLeaseManager) GetLeaseManager() (lease.LeaseCheckerWaite // be happy with a sync.Pool at minimum though. claimer, err := s.manager.Claimer(lease.ApplicationLeadershipNamespace, s.modelUUID.String()) if err != nil { - return nil, errors.Errorf("getting claim lease manager: %w", err) + return nil, internalerrors.Errorf("getting claim lease manager: %w", err) } checker, err := s.manager.Checker(lease.ApplicationLeadershipNamespace, s.modelUUID.String()) if err != nil { - return nil, errors.Errorf("getting checker lease manager: %w", err) + return nil, internalerrors.Errorf("getting checker lease manager: %w", err) } return &leaseManager{