Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Async catalog API middleware breaks error handling #503

Open
lauraseidler opened this issue Aug 7, 2020 · 0 comments
Open

Async catalog API middleware breaks error handling #503

lauraseidler opened this issue Aug 7, 2020 · 0 comments

Comments

@lauraseidler
Copy link
Contributor

With the changes introduced in #390, the catalog API middleware became async. While this works generally fine, it breaks the default express error handling - instead of invoking the next error handler, this will only cause an UnhandledPromiseRejectionWarning, and cause the request to hang and never return an error.

This can be reproduced e.g. by calling /api/catalog/anindexthatdoesnotexist/product/_search.

Wrapping the async middleware in an error handler would be required here - either custom built or using something like https://www.npmjs.com/package/express-async-handler.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant