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

[Beats CM] wrap non error in a try/catch in UI #26898

Merged
merged 1 commit into from
Dec 10, 2018
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
8 changes: 6 additions & 2 deletions x-pack/plugins/beats_management/public/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ export class AppRouter extends Component<RouterProps, RouterState> {

public async componentWillMount() {
if (this.state.loadingStatus === 'loading') {
await this.props.beatsContainer.reload();
await this.props.tagsContainer.reload();
try {
await this.props.beatsContainer.reload();
await this.props.tagsContainer.reload();
} catch (e) {
// TODO in a furture version we will better manage this "error" in a returned arg
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the description we expect a 404 here sometimes? Can we detect and ignore that specific error and rethrow others please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In a future release I’ll be refining how we handle errors throughout BeatsCM before GA, so refining now would be a wasted effort however non-ideal it might be

}

const countOfEverything =
this.props.beatsContainer.state.list.length + this.props.tagsContainer.state.list.length;
Expand Down