mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix some error handling and add XXX to do it better
This commit is contained in:
@@ -63,13 +63,17 @@ exports.loadCachedServerData = function () {
|
||||
console.log("No cached server data found on disk.");
|
||||
return noDataToken;
|
||||
}
|
||||
// XXX we should probably return an error to the caller here to
|
||||
// figure out how to handle it
|
||||
console.log(e.message);
|
||||
exit(1);
|
||||
process.exit(1);
|
||||
}
|
||||
var ret = JSON.parse(data);
|
||||
if (!ret) {
|
||||
var ret = noDataToken;
|
||||
try {
|
||||
ret = JSON.parse(data);
|
||||
} catch (err) {
|
||||
// XXX error handling
|
||||
console.log("Could not parse JSON in data.json.");
|
||||
return noDataToken;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user