Skip to content

Commit

Permalink
Print error when downloading dashboards
Browse files Browse the repository at this point in the history
An error was printed, but not what it was, and there can be two main
causes:
 * the download itself failed
 * the creation of the file on disk failed
  • Loading branch information
Tudor Golubenco committed Mar 24, 2017
1 parent 49c5acb commit 0b2216a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ https://github.com/elastic/beats/compare/v5.1.1...master[Check the HEAD diff]

- Add `_id`, `_type`, `_index` and `_score` fields in the generated index pattern. {pull}3282[3282]
- Fix potential elasticsearch output URL parsing error if protocol scheme is missing. {pull}3671[3671]
- Improve error message when downloading the dashboards fails. {pull}3805[3805]

*Filebeat*
- Always use absolute path for event and registry. {pull}3328[3328]
Expand Down
4 changes: 2 additions & 2 deletions libbeat/dashboards/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,12 @@ func (imp Importer) ImportArchive() error {
url := imp.cfg.SnapshotURL
archive, err = imp.downloadFile(url, target)
if err != nil {
return fmt.Errorf("Failed to download snapshot file: %s", url)
return fmt.Errorf("Failed to download snapshot file: %s. Error: %v", url, err)
}
} else if imp.cfg.URL != "" {
archive, err = imp.downloadFile(imp.cfg.URL, target)
if err != nil {
return fmt.Errorf("Failed to download file: %s", imp.cfg.URL)
return fmt.Errorf("Failed to download file: %s. Error: %v", imp.cfg.URL, err)
}
} else {
return errors.New("No archive file or URL is set - please use -file or -url option")
Expand Down

0 comments on commit 0b2216a

Please sign in to comment.