Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix httpd/main.js to not try/catch include() errors.

  • Loading branch information...
commit 25f3ff41200f2a99feb6f195b6ee65d6c01545d2 1 parent fdf5720
@mschwartz authored
Showing with 11 additions and 18 deletions.
  1. +5 −12 builtin/include.js
  2. +6 −6 httpd/main.js
View
17 builtin/include.js
@@ -13,7 +13,7 @@
return fn + '.coffee';
}
if (fn.substr(0,1) == '/' || fn.substr(0,2) == './' || fn.substr(0,3) == '../') {
- throw 'Could not locate include file ' + fn;
+ throw new Error('Could not locate include file ' + fn);
}
var paths = include.path;
for (var i=0, len=paths.length; i<len; i++) {
@@ -32,7 +32,7 @@
return fn + '.coffee';
}
}
- throw Error('Could not locate include file ' + fn);
+ throw new Error('Could not locate include file ' + fn);
}
var suffix = '.coffee',
suffixLen = suffix.length;
@@ -52,16 +52,9 @@
// log('\n'+source)
}
var script;
- try {
- script = v8.compileScript(contents, fn);
- v8.runScript(script);
- v8.freeScript(script);
- }
- catch (e) {
- throw "Could not compile " + fn + "\n" + e.toString();
- // console.dir(e);
- // throw e;
- }
+ script = v8.compileScript(contents, fn);
+ v8.runScript(script);
+ v8.freeScript(script);
}
include = function() {
var argLen = arguments.length;
View
12 httpd/main.js
@@ -336,13 +336,13 @@ function main() {
}
arguments.each(function(arg) {
if (arg.endsWith('.js') || arg.endsWith('.coffee')) {
- try {
+// try {
include(arg);
- }
- catch (e) {
- console.log('*** ' + e.toString());
- process.exit(1);
- }
+ // }
+ // catch (e) {
+ // console.log('*** ' + e.toString());
+ // process.exit(1);
+ // }
}
});
if (Config.mysql) {
Please sign in to comment.
Something went wrong with that request. Please try again.