tripviss / image-resizer

On-the-fly image resizing using Node.js and libvips. Heroku Ready!
MIT License
73 stars 45 forks source link

Needs better error handling for NODE_ENV value #40

Open LMS007 opened 7 years ago

LMS007 commented 7 years ago

My NODE_ENV was set to "dev" and thus produced a not-so-obvious error in heroku

Error: Cannot find module './src/config/dev'

^ that did not mean too much to me initially.

The stack trace was even less informative then that. I suggest a try catch with a message about what valid values the NODE_ENV can be set to... and perhaps it could default to using the development.js file with a warning if no matching file can be found.

Thanks!