We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am using the following code. Global error handler not getting call If any error happens in service.
class UserRoute { public static async AddNewUser(req: Request, res: Response, next: NextFunction): Promise<void> { const service = ServiceFactory.CreateService(UserService, req); let v = await service.AddUser(req.body) res.send(v); } } let router: Router = express.Router(); router.post('/' + UserRoute.AddNewUser.name, UserRoute.AddNewUser); export default router;
The text was updated successfully, but these errors were encountered:
@natarajanmca11 You should wrap it. Express does not support async/promise function. See use promise in http://expressjs.com/en/advanced/best-practice-performance.html#promises And there is also an article mentioned in this page, https://strongloop.com/strongblog/async-error-handling-expressjs-es7-promises-generators/
Sorry, something went wrong.
To work around this for now, you can use something like https://github.com/blakeembrey/async-middleware. For native support, you might want to follow #2259.
No branches or pull requests
I am using the following code. Global error handler not getting call If any error happens in service.
The text was updated successfully, but these errors were encountered: