Skip to content

Commit f761ee6

Browse files
authored
fix(update): make sure we always return underline error (#95)
1 parent 537694f commit f761ee6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/update/apt/service.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ func restartServices(ctx context.Context) error {
287287
if err != nil {
288288
return err
289289
}
290-
return needRestartCmd.RunWithinContext(ctx)
290+
if out, err := needRestartCmd.RunAndCaptureCombinedOutput(ctx); err != nil {
291+
return fmt.Errorf("error running needrestart command: %w: %s", err, out)
292+
}
293+
return nil
291294
}
292295

293296
func listUpgradablePackages(ctx context.Context, matcher func(update.UpgradablePackage) bool) ([]update.UpgradablePackage, error) {

0 commit comments

Comments
 (0)