don't crash the server if one line of a pin log is invalid
This commit is contained in:
@@ -29,7 +29,13 @@ const checkPinStatus = (pinFile, fileName) => {
|
|||||||
l[1].forEach((x) => { delete pins[x]; });
|
l[1].forEach((x) => { delete pins[x]; });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: throw new Error(JSON.stringify(l) + ' ' + fileName);
|
default:
|
||||||
|
// TODO write to the error log
|
||||||
|
/* Log.error('CORRUPTED_PIN_LOG', {
|
||||||
|
line: JSON.stringify(l),
|
||||||
|
fileName: fileName,
|
||||||
|
}); */
|
||||||
|
console.error(new Error (JSON.stringify(l) + ' ' + fileName));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return Object.keys(pins);
|
return Object.keys(pins);
|
||||||
|
|||||||
Reference in New Issue
Block a user