Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log error when "Export All" ES query fails #6976

Merged
merged 2 commits into from
May 6, 2016

Conversation

bevacqua
Copy link
Contributor

Related: #6774 #6776.

@epixa: This PR is cleaner.

@epixa
Copy link
Contributor

epixa commented Apr 19, 2016

jenkins, test it

$scope.exportAll = () => Promise.map($scope.services, service => service.service
.scanAll('')
.then(results => results.hits.map(hit => _.extend(hit, { type: service.type })))
.catch(error => notify.error(error))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually results in three different error blocks in the "more info" section of the error banner. I assume because there are three services or something, though I'm not familiar enough with this feature to say for certain. Perhaps the notify behavior should be moved to a .catch() on the .map() promise instead?

@epixa epixa assigned bevacqua and unassigned epixa Apr 19, 2016
@bevacqua bevacqua assigned epixa and unassigned bevacqua Apr 20, 2016
@bevacqua
Copy link
Contributor Author

@epixa There!

@epixa
Copy link
Contributor

epixa commented Apr 22, 2016

LGTM

@epixa epixa assigned bevacqua and unassigned epixa Apr 22, 2016
@bevacqua bevacqua assigned LeeDr and unassigned bevacqua May 5, 2016
@LeeDr
Copy link
Contributor

LeeDr commented May 5, 2016

I'm confused. On master I already get the toast message Saved Objects: No saved objects to export. when there's no saved objects and I try to "Export everything". So what is this PR changing?

@LeeDr LeeDr assigned bevacqua and unassigned LeeDr May 5, 2016
@bevacqua
Copy link
Contributor Author

bevacqua commented May 5, 2016

@LeeDr This ensures that if the request to the API fails for some reason (e.g a malformed request or failure to produce a response), an error notification appears in the developer console.

It originally arised from searchType: 'scan' being part of the query. If you add that back, you can verify that the message appears.

@bevacqua bevacqua assigned LeeDr and unassigned bevacqua May 5, 2016
@bevacqua bevacqua changed the title Display toast notification when "Export All" ES query fails Log error when "Export All" ES query fails May 5, 2016
@LeeDr
Copy link
Contributor

LeeDr commented May 5, 2016

I don't like adding an error notification to the dev console, and not showing a toast message to the user. Maybe I'm still not understanding this PR. I'd like to zoom about it, maybe with @epixa when we're all available.

@LeeDr LeeDr removed their assignment May 5, 2016
@epixa
Copy link
Contributor

epixa commented May 6, 2016

@LeeDr: The errors do appear in the toast message. You should be able to verify this by adding searchType: 'scan', after this line: https://github.com/elastic/kibana/blob/master/src/ui/public/utils/scanner.js#L66 and then trying to export all.

@LeeDr
Copy link
Contributor

LeeDr commented May 6, 2016

LGTM
Before this change, with epixa's suggested test I just got an error page. With this change I get the toast message in the UI.

@bevacqua bevacqua removed their assignment May 6, 2016
@bevacqua bevacqua merged commit 8f12fbf into elastic:master May 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants