Belphemur / json-db-node-red

Node-RED Node to store easilly
GNU General Public License v3.0
5 stars 17 forks source link

Can't Load Database: Unexpected end of JSON input #10

Closed soenkegissel closed 1 year ago

soenkegissel commented 1 year ago

If I unexpectedly power off my raspberry pi, after a reboot it can happen that this database will not work. I get the following error. Maybe during the power off it was written to it. I need to remove the file.

20 Feb 19:55:47 - [error] [DataIn:a4b05396bf5dc9ac] DatabaseError: Can't Load Database: SyntaxError: Unexpected end of JSON input

Can a check be implemented for handling the Unexpected end of JSON input?

Belphemur commented 1 year ago

To be honest, there isn't much I can do.

if the file is corrupted, a human need to look at it and fix it. The corruption won't be always the same.