Skip to content

Commit 4f527c0

Browse files
committed
Rename DuplicateProfileError -> ProfileAlreadyExitsError
1 parent dbafbe6 commit 4f527c0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

commands/cmderrors/cmderrors.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,17 +215,17 @@ func (e *UnknownProfileError) GRPCStatus() *status.Status {
215215
return status.New(codes.NotFound, e.Error())
216216
}
217217

218-
// DuplicateProfileError is returned when the profile is a duplicate of an already existing one
219-
type DuplicateProfileError struct {
218+
// ProfileAlreadyExitsError is returned when the profile is a duplicate of an already existing one
219+
type ProfileAlreadyExitsError struct {
220220
Profile string
221221
}
222222

223-
func (e *DuplicateProfileError) Error() string {
223+
func (e *ProfileAlreadyExitsError) Error() string {
224224
return i18n.Tr("Profile '%s' already exists", e.Profile)
225225
}
226226

227227
// GRPCStatus converts the error into a *status.Status
228-
func (e *DuplicateProfileError) GRPCStatus() *status.Status {
228+
func (e *ProfileAlreadyExitsError) GRPCStatus() *status.Status {
229229
return status.New(codes.AlreadyExists, e.Error())
230230
}
231231

commands/service_profile_init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (s *arduinoCoreServerImpl) ProfileCreate(ctx context.Context, req *rpc.Prof
5757

5858
// Check that the profile name is unique
5959
if profile, _ := sk.GetProfile(req.ProfileName); profile != nil {
60-
return nil, &cmderrors.DuplicateProfileError{Profile: req.ProfileName}
60+
return nil, &cmderrors.ProfileAlreadyExitsError{Profile: req.ProfileName}
6161
}
6262

6363
pme, release, err := instances.GetPackageManagerExplorer(req.GetInstance())

0 commit comments

Comments
 (0)