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
None of the inversify-express-utils examples show the "correct" way to handle errors.
inversify-express-utils
@httpGet("/:id") public async getUser(): Promise<User> { try { const id = this.httpContext.request.params.id; return await this._userRepository.get(id); } catch (e) { this.httpContext.response.status(404); // ...what goes here? <------------------------------------- } }
I know I can omit the return type, but I don't want to circumvent the type system.
So what do I put in the catch block?
Is it appropriate to use return Promise.reject(); or will that lead to problems?
return Promise.reject();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
None of the
inversify-express-utils
examples show the "correct" way to handle errors.I know I can omit the return type, but I don't want to circumvent the type system.
So what do I put in the catch block?
Is it appropriate to use
return Promise.reject();
or will that lead to problems?The text was updated successfully, but these errors were encountered: