-
Notifications
You must be signed in to change notification settings - Fork 2k
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
using async in formatError hook, error message will be no complete #1747
Comments
I found calling the formatError function without async when I searched the source code, the code position is :
|
Hi there |
Hi @cheapsteak,
|
@marlonfsolis Here's the skeleton of a plugin which implements plugins: [{
async requestDidStart() {
return {
async didEncounterErrors(requestContext) {
// log to service
}
};
}
}] |
when I use async function in formatError hook, for example:
formatError:async (error) => { // some other async code console.log(error); return error; }
the error message sent to client don't contain error detail, just like this:
{ "data":null, "errors":[{}] }
if I remove async , the error message sent to client will be complete, wish some body help me, thanks a lot
The text was updated successfully, but these errors were encountered: