WebThingsIO / thing-url-adapter

Proxy adapter for Web Thing API endpoints
Mozilla Public License 2.0
22 stars 18 forks source link

unreachable thing-url reports an error (log-spew) #58

Closed dhylands closed 5 years ago

dhylands commented 5 years ago

I saw this:

2018-10-11 19:07:26.133 thing-url: Failed to connect to http://192.168.1.128: { FetchError: request to http://192.168.1.128/ failed, reason: connect EHOSTUNREACH 192.168.1.128:80
2018-10-11 19:07:26.134 thing-url:     at ClientRequest.<anonymous> (/home/pi/.mozilla-iot/addons/thing-url-adapter/node_modules/node-fetch/lib/index.js:1345:11)
2018-10-11 19:07:26.134 thing-url:     at emitOne (events.js:116:13)
2018-10-11 19:07:26.134 thing-url:     at ClientRequest.emit (events.js:211:7)
2018-10-11 19:07:26.134 thing-url:     at Socket.socketErrorListener (_http_client.js:387:9)
2018-10-11 19:07:26.134 thing-url:     at emitOne (events.js:116:13)
2018-10-11 19:07:26.134 thing-url:     at Socket.emit (events.js:211:7)
2018-10-11 19:07:26.134 thing-url:     at emitErrorNT (internal/streams/destroy.js:66:8)
2018-10-11 19:07:26.134 thing-url:     at _combinedTickCallback (internal/process/next_tick.js:139:11)
2018-10-11 19:07:26.134 thing-url:     at process._tickCallback (internal/process/next_tick.js:181:9)
2018-10-11 19:07:26.134 thing-url:   message: 'request to http://192.168.1.128/ failed, reason: connect EHOSTUNREACH 192.168.1.128:80',
2018-10-11 19:07:26.134 thing-url:   type: 'system',
2018-10-11 19:07:26.134 thing-url:   errno: 'EHOSTUNREACH',
2018-10-11 19:07:26.134 thing-url:   code: 'EHOSTUNREACH' }

The thing-url adapter should catch this error and report a single line.