Trying explicitly throwing error to trigger catch clause
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 37s
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 37s
This commit is contained in:
parent
116f0a9446
commit
21469c647a
1 changed files with 2 additions and 2 deletions
|
|
@ -78,13 +78,13 @@ export function Controller<T extends { new (...args: any[]): BaseController }>()
|
|||
const path = Reflect.getMetadata(GET_METADATA_KEY, target.prototype, method);
|
||||
|
||||
// Bind the method to the class instance
|
||||
app.get(path, (req, res, next) => {
|
||||
app.get(path, async (req, res, next) => {
|
||||
console.log('[Controller.setup.<GET request>] Request:', req);
|
||||
console.log('[Controller.setup.<GET request>] Response:', res);
|
||||
console.log('[Controller.setup.<GET request>] Next:', next);
|
||||
|
||||
try {
|
||||
Promise.all([fn.bind(controller)(req, res, next)])
|
||||
await Promise.all([fn.bind(controller)(req, res, next)])
|
||||
.catch((error) => { throw new Error(error) });
|
||||
}
|
||||
catch(error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue