JonAbrams / synth

The first back-end framework specially designed for single-page web applications
http://www.synthjs.com
MIT License
968 stars 70 forks source link

output "No synth app detected" in non-synth-app directory #54

Closed kumagi closed 10 years ago

kumagi commented 10 years ago

Thrown error in requiring back/back-app was not catched. So error message was such a mess.

$ synth s

module.js:340
    throw err;
    ^
Error: Cannot find module '/home/kumagi/back/back-app'
  at Function.Module._resolveFilename (module.js:338:15)
  at Function.require.resolve (module.js:384:19)
  at requireUncached (/path/to/synth/synth/lib/requireUncached.js:16:14)
  at startServer (/path/to/synth/synth/lib/commands.js:65:15)
  at Object.exports.startServer (/path/to/synth/synth/lib/commands.js:95:5)
  at Object.<anonymous> (/path/to/synth/synth/bin/synth:64:12)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:902:3

It should be

$ synth s
No synth app detected.

Thanks.

JonAbrams commented 10 years ago

Good find, thanks!

JonAbrams commented 10 years ago

Could you check to make sure the error is the one you're expecting?

e.g. if (err.code === 'MODULE_NOT_FOUND') { … }

kumagi commented 10 years ago

OK. I'll do it, please wait.

JonAbrams commented 10 years ago

Still planning to make the change or would you like me to do it?

JonAbrams commented 10 years ago

I had to rework it anyways since the PR no longer merged cleanly. Thanks for the submission though!