Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there,
This pull request is a first step to allow async formatError (and other extensions). It completes #1748 and closes #1747
Motivation
The motivation is for the lambda integration: a synchronous call to log an error is not satisfying, it needs to be awaited, otherwise the process is frozen before the resolution of the formatError promise. For exemple, if we want to send the error to an external service (sentry), it's never sent.
Tests - problems
There are still a few issues: express, hapi and koa integration are synchronous, and hence the tests cannot pass. Is there a way to enable this feature only for the other integrations ? Given the motivation, this feature is not really useful for those integrations.
Going further
I also saw in the code TODOs related to this synchronous -> asynchronous migration, is there a roadmap for thise ? Because of these synchronous integrations, there is a lot of code only to achieve retrocompatibility (isPromise, etc.)
What it does
What it does:
IMO, in the future: the whole extension stack should work with Promises, and the entry variables should be converted with
Promise.resolve(variables)
. The code would be more readable.TODO:
I do that as soon as I have guidance to fix this specific test issue :). What's the next step ?
Thank you !
Best,