From 6ca2d7b1dca19e2ef23d508acaeeacd523ede252 Mon Sep 17 00:00:00 2001 From: lichengyin Date: Sat, 29 Aug 2015 13:54:16 +0800 Subject: [PATCH] remove unnecessary try catch --- src/core/app.js | 6 +----- src/index.js | 10 +++------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/core/app.js b/src/core/app.js index 6b0070e1..5ae2f8b0 100644 --- a/src/core/app.js +++ b/src/core/app.js @@ -135,11 +135,7 @@ export default class extends think.base { //createServer callback let callback = async (req, res) => { let http = await think.http(req, res); - try{ - return new this(http).run(); - }catch(e){ - think.log(e); - } + return new this(http).run(); }; let server; //define createServer in application diff --git a/src/index.js b/src/index.js index 2255af54..22b79df9 100644 --- a/src/index.js +++ b/src/index.js @@ -398,12 +398,8 @@ export default class { * run * @return {} [] */ - async run(){ - try{ - this.start(); - await think.require('app').run(); - }catch(err){ - think.log(err); - } + run(){ + this.start(); + return think.require('app').run(); } } \ No newline at end of file