Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion internal/cmd/confluence/page/attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,13 @@ func downloadAllAttachments(opts *AttachmentOptions, confluence *api.ConfluenceS
Downloads: downloads,
Errors: errors,
}
return output.JSON(opts.IO.Out, result)
if err := output.JSON(opts.IO.Out, result); err != nil {
return err
}
if len(errors) > 0 {
return fmt.Errorf("failed to download %d attachment(s)", len(errors))
}
return nil
}

if len(errors) > 0 {
Expand All @@ -324,6 +330,9 @@ func downloadAllAttachments(opts *AttachmentOptions, confluence *api.ConfluenceS
}

fmt.Fprintf(opts.IO.Out, "\nDownloaded %d of %d attachments to %s\n", len(downloads), len(attachments), opts.OutputDir)
if len(errors) > 0 {
return fmt.Errorf("failed to download %d attachment(s)", len(errors))
}
Comment thread
Hinne1 marked this conversation as resolved.
return nil
}

Expand Down
Loading