-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
The try-catch block in function temperature() covers its callback. This way the library catches all exceptions thrown in the callback, even unrelated ones from applications using the library, and causes it to fail.
Line 85 in 6a8e71a
| return callback(new Error('Can not read temperature for sensor ' + sensor)); |
Example:
ds18b20.temperature(id, (error, value) => {
throw new Error("Custom error unrelated to ds18b20");
}Output:
ERROR: Can not read temperature for sensor XY
The try-catch block should only catch exceptions from parseData() instead.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels