Skip to content

Commit

Permalink
Changed error name to codebase convention
Browse files Browse the repository at this point in the history
  • Loading branch information
RohaanAdvani68 authored and lholznagel committed Aug 28, 2017
1 parent 56d5af9 commit dc5c192
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,14 @@ export class InversifyExpressServer {
return (req: express.Request, res: express.Response, next: express.NextFunction) => {
let args = this.extractParameters(req, res, next, parameterMetadata);
let result: any = this._container.getNamed(TYPE.Controller, controllerName)[key](...args);
// try to resolve promise
Promise.resolve(result)
.then((value: any) => {
if (value && !res.headersSent) {
res.send(value);
}
})
.catch((err: any) => {
next(err); });
.catch((error: any) => {
next(error); });
};
}

Expand Down

0 comments on commit dc5c192

Please sign in to comment.