Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better error message on local.json parse failure

  • Loading branch information...
commit fdb5d48b136a16afafe3caacbffa54234e519798 1 parent d0f23ab
@kriszyp authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/settings.js
View
12 lib/settings.js
@@ -3,8 +3,12 @@ try{
}catch(e){
read = require("file").read;
}
-
-var settings = JSON.parse(read("local.json").toString("utf8"));
-for(var i in settings){
- exports[i] = settings[i];
+try{
+ var settings = JSON.parse(read("local.json").toString("utf8"));
+ for(var i in settings){
+ exports[i] = settings[i];
+ }
+}catch(e){
+ e.message += " trying to load local.json, make sure local.json is in your current working directory";
+ throw e;
}
Please sign in to comment.
Something went wrong with that request. Please try again.