Skip to content

Commit

Permalink
proper error message when module require; new version
Browse files Browse the repository at this point in the history
  • Loading branch information
apla committed Jul 31, 2013
1 parent 55b60a1 commit 748c004
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,15 +576,22 @@ if ($isServerSide) {
try {
mod = require(inProjectPath);
} catch (e) {
// assuming format: Error: Cannot find module 'csv2array' {"code":"MODULE_NOT_FOUND"}
if (e.toString().indexOf(name + '\'') > 0 && e.code == "MODULE_NOT_FOUND") {
try {
mod = require(inPackagePath);
} catch (e) {
} catch (ee) {
if (ee.toString().indexOf(name + '\'') > 0 && ee.code == "MODULE_NOT_FOUND") {
try {
mod = require(name);
} catch (e) {
} catch (eee) {
if (!(eee.toString().indexOf(name + '\'') > 0 && eee.code == "MODULE_NOT_FOUND"))
console.error ('when require \"' + name + '\": ' + eee.toString());
mod = null;
}
}
}} else
console.error ('when require \"' + inPackagePath + '\": ' + ee.toString());
}} else
console.error ('when require \"' + inProjectPath + '\": ' + e.toString());
}
return mod;
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dataflo.ws",
"description": "Zero-code JSON config-based workflow engine for Node, PhoneGap and browser.",
"version": "0.0.41",
"version": "0.0.42",
"keywords": [
"flow-based-programming",
"workflow",
Expand Down

0 comments on commit 748c004

Please sign in to comment.