w3c / web-of-things-framework

208 stars 63 forks source link

Exception when log file doesn't yet exist #38

Open draggett opened 9 years ago

draggett commented 9 years ago

I get the following expected error:

error: couldn't load http://localhost:9999/wot/switch12, error: Error: connect ECONNREFUSED

This is expected since there is no server running on port 9999. However, this is followed by the exception:

error: uncaughtException: ENOENT, open '/Users/dsr/Projects/webofthings/logs/application.log' date=Tue Aug 04 2015 10:32:11 GMT+0100 (BST), pid=80159, uid=501, gid=20, cwd=/Users/dsr/Projects/webofthings, execPath=/usr/local/bin/node, version=v0.12.6, argv=[node, /Users/dsr/Projects/webofthings/demo.js], rss=41631744, heapTotal=31598080, heapUsed=16440920, loadavg=[1.99853515625, 1.947265625, 1.9375], uptime=1188314, trace=[column=null, file=null, function=Error, line=null, method=null, native=true], stack=[Error: ENOENT, open '/Users/dsr/Projects/webofthings/logs/application.log', at Error (native)]

This could be caused by a failure of the logger to create the log file if it doesn't already exist

drasko commented 9 years ago

Described in my comments on PR https://github.com/w3c/web-of-things-framework/pull/37

draggett commented 9 years ago

On 4 Aug 2015, at 12:57, Drasko DRASKOVIC notifications@github.com wrote:

Described in my comments on PR #37 https://github.com/w3c/web-of-things-framework/pull/37: #37 https://github.com/w3c/web-of-things-framework/pull/37 I see that it requires the logging directory to exist - can you fix it so that this is created if it doesn’t exist.

Many thanks, — Dave Raggett <dsr@w3.org mailto:dsr@w3.org>

drasko commented 9 years ago

@draggett maybe we should consider having a separate develop (or next, as Linux calls it) branch, so that master can always be functional. This way everybody would send PR to develop and someone will integrate only functional and tested parts on master from time to time.

draggett commented 9 years ago

Sounds good -- note that I am a relative newcomer to working with Git, and am happy to have help.