Skip to content

Commit 7845e84

Browse files
committed
Handle error
Signed-off-by: Joseph <jvaikath@redhat.com>
1 parent 4b65b7b commit 7845e84

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/root.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ func replaceVeleroWithOADP(cmd *cobra.Command) *cobra.Command {
106106

107107
// Read captured output and replace velero with oadp (context-aware)
108108
var buf strings.Builder
109-
io.Copy(&buf, r)
109+
_, err := io.Copy(&buf, r)
110+
if err != nil {
111+
fmt.Fprintf(os.Stderr, "WARNING: Error copying output: %v\n", err)
112+
}
110113
output := replaceVeleroCommandWithOADP(buf.String())
111114
fmt.Print(output)
112115
}

0 commit comments

Comments
 (0)