Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Crash when log destination is unwritable #176

Open
djorlando24 opened this issue Jul 20, 2021 · 0 comments
Open

Crash when log destination is unwritable #176

djorlando24 opened this issue Jul 20, 2021 · 0 comments

Comments

@djorlando24
Copy link

On MacOS, if the location in logger-config.json has no write permission or doesn't exist, the program fails ungracefully:

/Users/dduke/src/tplink-energy-monitor/src/services/data-logger.js:51
    console.warn('Error writing log for ' + device.alias + ' [' + device.deviceId + ']', err);
                                            ^

ReferenceError: device is not defined
    at writeLog (/Users/dduke/src/tplink-energy-monitor/src/services/data-logger.js:51:45)
    at /Users/dduke/src/tplink-energy-monitor/src/services/data-logger.js:60:7
    at FSReqCallback.oncomplete (node:fs:185:23)

A nice error saying "sorry your log file could not be written" would be better!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant