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

Don't discard all promises results when one of them rejects #25302

Merged
merged 2 commits into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions packages/edit-navigation/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const fetchLinkSuggestions = (
type: 'post',
subtype,
} ),
} )
} ).catch( () => [] ) // fail by returning no results
Copy link
Member

Choose a reason for hiding this comment

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

Is the error important for us to know about?

In other words, will discarding the error entirely be problematic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe. But the failure wasn't handled before this change anyways, so there is no regression.

);
}

Expand All @@ -79,7 +79,7 @@ const fetchLinkSuggestions = (
type: 'term',
subtype,
} ),
} )
} ).catch( () => [] )
);
}

Expand All @@ -92,7 +92,7 @@ const fetchLinkSuggestions = (
type: 'post-format',
subtype,
} ),
} )
} ).catch( () => [] )
);
}

Expand Down
6 changes: 3 additions & 3 deletions packages/editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const fetchLinkSuggestions = (
type: 'post',
subtype,
} ),
} )
} ).catch( () => [] ) // fail by returning no results
);
}

Expand All @@ -77,7 +77,7 @@ const fetchLinkSuggestions = (
type: 'term',
subtype,
} ),
} )
} ).catch( () => [] )
);
}

Expand All @@ -90,7 +90,7 @@ const fetchLinkSuggestions = (
type: 'post-format',
subtype,
} ),
} )
} ).catch( () => [] )
);
}

Expand Down