Skip to content

Commit 2b8d6d7

Browse files
Remove empty object from the output of grpc commands (#2057)
1 parent 3ac8320 commit 2b8d6d7

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

Diff for: commands/daemon/daemon.go

+7-28
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,7 @@ func (s *ArduinoCoreServerImpl) UpdateLibrariesIndex(req *rpc.UpdateLibrariesInd
159159
err := commands.UpdateLibrariesIndex(stream.Context(), req,
160160
func(p *rpc.DownloadProgress) { stream.Send(&rpc.UpdateLibrariesIndexResponse{DownloadProgress: p}) },
161161
)
162-
if err != nil {
163-
return convertErrorToRPCStatus(err)
164-
}
165-
return stream.Send(&rpc.UpdateLibrariesIndexResponse{})
162+
return convertErrorToRPCStatus(err)
166163
}
167164

168165
// Create FIXMEDOC
@@ -357,10 +354,7 @@ func (s *ArduinoCoreServerImpl) LibraryInstall(req *rpc.LibraryInstallRequest, s
357354
func(p *rpc.DownloadProgress) { stream.Send(&rpc.LibraryInstallResponse{Progress: p}) },
358355
func(p *rpc.TaskProgress) { stream.Send(&rpc.LibraryInstallResponse{TaskProgress: p}) },
359356
)
360-
if err != nil {
361-
return convertErrorToRPCStatus(err)
362-
}
363-
return stream.Send(&rpc.LibraryInstallResponse{})
357+
return convertErrorToRPCStatus(err)
364358
}
365359

366360
// LibraryUpgrade FIXMEDOC
@@ -370,21 +364,15 @@ func (s *ArduinoCoreServerImpl) LibraryUpgrade(req *rpc.LibraryUpgradeRequest, s
370364
func(p *rpc.DownloadProgress) { stream.Send(&rpc.LibraryUpgradeResponse{Progress: p}) },
371365
func(p *rpc.TaskProgress) { stream.Send(&rpc.LibraryUpgradeResponse{TaskProgress: p}) },
372366
)
373-
if err != nil {
374-
return convertErrorToRPCStatus(err)
375-
}
376-
return stream.Send(&rpc.LibraryUpgradeResponse{})
367+
return convertErrorToRPCStatus(err)
377368
}
378369

379370
// LibraryUninstall FIXMEDOC
380371
func (s *ArduinoCoreServerImpl) LibraryUninstall(req *rpc.LibraryUninstallRequest, stream rpc.ArduinoCoreService_LibraryUninstallServer) error {
381372
err := lib.LibraryUninstall(stream.Context(), req,
382373
func(p *rpc.TaskProgress) { stream.Send(&rpc.LibraryUninstallResponse{TaskProgress: p}) },
383374
)
384-
if err != nil {
385-
return convertErrorToRPCStatus(err)
386-
}
387-
return stream.Send(&rpc.LibraryUninstallResponse{})
375+
return convertErrorToRPCStatus(err)
388376
}
389377

390378
// LibraryUpgradeAll FIXMEDOC
@@ -393,10 +381,7 @@ func (s *ArduinoCoreServerImpl) LibraryUpgradeAll(req *rpc.LibraryUpgradeAllRequ
393381
func(p *rpc.DownloadProgress) { stream.Send(&rpc.LibraryUpgradeAllResponse{Progress: p}) },
394382
func(p *rpc.TaskProgress) { stream.Send(&rpc.LibraryUpgradeAllResponse{TaskProgress: p}) },
395383
)
396-
if err != nil {
397-
return convertErrorToRPCStatus(err)
398-
}
399-
return stream.Send(&rpc.LibraryUpgradeAllResponse{})
384+
return convertErrorToRPCStatus(err)
400385
}
401386

402387
// LibraryResolveDependencies FIXMEDOC
@@ -429,10 +414,7 @@ func (s *ArduinoCoreServerImpl) ZipLibraryInstall(req *rpc.ZipLibraryInstallRequ
429414
stream.Context(), req,
430415
func(p *rpc.TaskProgress) { stream.Send(&rpc.ZipLibraryInstallResponse{TaskProgress: p}) },
431416
)
432-
if err != nil {
433-
return convertErrorToRPCStatus(err)
434-
}
435-
return stream.Send(&rpc.ZipLibraryInstallResponse{})
417+
return convertErrorToRPCStatus(err)
436418
}
437419

438420
// GitLibraryInstall FIXMEDOC
@@ -441,10 +423,7 @@ func (s *ArduinoCoreServerImpl) GitLibraryInstall(req *rpc.GitLibraryInstallRequ
441423
stream.Context(), req,
442424
func(p *rpc.TaskProgress) { stream.Send(&rpc.GitLibraryInstallResponse{TaskProgress: p}) },
443425
)
444-
if err != nil {
445-
return convertErrorToRPCStatus(err)
446-
}
447-
return stream.Send(&rpc.GitLibraryInstallResponse{})
426+
return convertErrorToRPCStatus(err)
448427
}
449428

450429
// EnumerateMonitorPortSettings FIXMEDOC

0 commit comments

Comments
 (0)