Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
error = new apollo.AuthenticationError(message);
} else if (statusCode === 403) {
error = new apollo.ForbiddenError(message);
} else {
error = new apollo.UserInputError(message);
}
if (err && err.stack) {
if (removeUserStack) {
error.stack = undefined;
} else {
error.stack = err.stack;
}
}
} else {
error = apollo.toApolloError(err, code);
}
return error;
};
}