Skip to content

Commit 3b05ce7

Browse files
author
sasdf
committed
Revert "App not exist exception"
This reverts commit 2c7cb62.
1 parent 2c7cb62 commit 3b05ce7

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

coder-base/server.js

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,20 @@ var querystring = require('querystring');
3636
var loadApp = function( loadpath ) {
3737

3838
var userapp = null;
39-
try{
40-
if ( config.cacheApps ) {
41-
userapp = require(loadpath);
42-
} else {
39+
if ( config.cacheApps ) {
40+
userapp = require(loadpath);
41+
} else {
4342

44-
var cached = require.cache[loadpath + '.js'];
45-
if ( cached ) {
46-
userapp = require(loadpath);
47-
if ( userapp.on_destroy ) {
48-
userapp.on_destroy();
49-
}
50-
delete require.cache[loadpath + ".js"];
51-
}
52-
userapp = require(loadpath);
53-
}
54-
} catch ( err ) { userapp = null; }
43+
var cached = require.cache[loadpath + '.js'];
44+
if ( cached ) {
45+
userapp = require(loadpath);
46+
if ( userapp.on_destroy ) {
47+
userapp.on_destroy();
48+
}
49+
delete require.cache[loadpath + ".js"];
50+
}
51+
userapp = require(loadpath);
52+
}
5553
return userapp;
5654
};
5755

@@ -63,10 +61,6 @@ var apphandler = function( req, res, appdir ) {
6361
var modpath = appdir + appname;
6462
var userapp = loadApp( modpath + "/app" );
6563

66-
if ( userapp === null ) {
67-
res.send( 'App not found.' );
68-
return;
69-
}
7064

7165
util.log( "GET: " + apppath + " " + appname );
7266

0 commit comments

Comments
 (0)