garden / tree

A multiplayer file system
https://thefiletree.com
European Union Public License 1.2
70 stars 23 forks source link

JSON Syntax Error wiping a file #131

Closed jankeromnes closed 11 years ago

jankeromnes commented 12 years ago

Was minding my own business, when this error happened, the server crashed and restarted and my file was wiped blank. Had to fetch backup to fix it (file was webjson.js). We should fix it and be way more robust to errors.

While loading metadata for /lib/js/webjson.js : Error: JSON Syntax Error
    at /home/dom/tree/lib/driver.js:65:31
    at [object Object].<anonymous> (fs.js:123:5)
    at [object Object].emit (events.js:64:17)
    at Object.oncomplete (fs.js:1190:12)
[Error: JSON Syntax Error]

http.js:536
    throw new Error("Can't set headers after they are sent.");
          ^
Error: Can't set headers after they are sent.
    at ServerResponse.setHeader (http.js:536:11)
    at end (/home/dom/tree/node_modules/camp/lib/camp.js:437:17)
    at /home/dom/tree/lib/plug.js:45:13
    at Object.file (/home/dom/tree/lib/fs.js:109:5)
    at end (/home/dom/tree/lib/plug.js:40:12)
    at /home/dom/tree/lib/plug.js:171:40
    at /home/dom/tree/lib/fs.js:288:7
    at /home/dom/tree/lib/fs.js:208:7
    at [object Object].<anonymous> (fs.js:123:5)
    at [object Object].emit (events.js:64:17)
jankeromnes commented 12 years ago

Well thank you, past myself, for explaining in such a detailed fashion how to reproduce this error.

jankeromnes commented 11 years ago

Closing, probably fixed by now.